@illuminis/comprism 0.1.8 → 2.4.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.
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 +128 -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,58 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.APPROX_CHARS_PER_TOKEN = void 0;
4
- exports.normalisePrompt = normalisePrompt;
5
- exports.fingerprint = fingerprint;
6
- exports.newId = newId;
7
- exports.approxTokens = approxTokens;
8
- /**
9
- * Fingerprinting: how a request is identified without being kept.
10
- *
11
- * Every record refers to a request by the sha256 of its normalized text. The
12
- * text itself is never written anywhere. Two consequences the rest of the
13
- * system depends on:
14
- *
15
- * - A verbatim retry produces the identical fingerprint, which is how Phase 2
16
- * recognizes two calls as attempts at the same unit of work without ever
17
- * comparing the words.
18
- * - Nothing can be reversed out of the record. A fingerprint identifies a
19
- * request to someone who already has it, and is inert to everyone else.
20
- */
21
- const node_crypto_1 = require("node:crypto");
22
- /**
23
- * Normalization before hashing: lowercase, collapse runs of whitespace, trim.
24
- *
25
- * Deliberately mild. Aggressive normalization (stripping punctuation, stemming)
26
- * would collapse genuinely different requests onto one fingerprint, and a
27
- * fingerprint collision is a chain-linking error that is invisible afterwards.
28
- */
29
- function normalisePrompt(prompt) {
30
- return prompt.replace(/\s+/g, ' ').trim().toLowerCase();
31
- }
32
- function fingerprint(prompt) {
33
- return (0, node_crypto_1.createHash)('sha256').update(normalisePrompt(prompt), 'utf8').digest('hex');
34
- }
35
- /**
36
- * A short, stable id. `crypto.randomUUID` would do, but ids appear in every
37
- * report and a 12-character id is legible in a terminal where a UUID is noise.
38
- */
39
- function newId(prefix) {
40
- const rand = (0, node_crypto_1.createHash)('sha256')
41
- .update(`${process.pid}:${Date.now()}:${Math.random()}`)
42
- .digest('hex')
43
- .slice(0, 12);
44
- return `${prefix}_${rand}`;
45
- }
46
- /**
47
- * Context size in tokens, approximated from characters.
48
- *
49
- * Four characters per token is the industry's usual rule of thumb and it is an
50
- * approximation, not a measurement - which is why every figure derived from it
51
- * carries `derivation: 'inferred'` with this method named. The provider's own
52
- * reported token counts are used wherever they exist; this is only for the
53
- * context estimate that has to exist *before* the call is made.
54
- */
55
- exports.APPROX_CHARS_PER_TOKEN = 4;
56
- function approxTokens(text) {
57
- return Math.ceil(text.length / exports.APPROX_CHARS_PER_TOKEN);
58
- }
@@ -1,427 +0,0 @@
1
- export interface Decision {
2
- /** The model that finishes the work for least. Null when we could not decide. */
3
- model: string | null;
4
- /** What the caller would have run without us. */
5
- would_have_used: string;
6
- tier: string;
7
- signals: string[];
8
- /**
9
- * True only when the figure rests on a close match in the corpus. False means
10
- * a coarser lookup answered, and every surface must show it as an estimate.
11
- */
12
- confident: boolean;
13
- rung: string | null;
14
- rationale: string | null;
15
- }
16
- /** One model, as a person choosing between them needs to see it. */
17
- export interface CatalogModel {
18
- key: string;
19
- id: string;
20
- label: string;
21
- provider: string;
22
- tier: string;
23
- /** True when this workspace can call it with no further setup. */
24
- reachable: boolean;
25
- /** Why it cannot be reached, in words a person can act on. */
26
- why_not: string | null;
27
- }
28
- /** One vendor and its models. */
29
- export interface CatalogProvider {
30
- provider: string;
31
- label: string;
32
- has_key: boolean;
33
- permitted: boolean;
34
- models: CatalogModel[];
35
- }
36
- /**
37
- * One session's cost, as the server worked it out.
38
- *
39
- * Deliberately loose below the top level: the fields are named by the service
40
- * and a client that re-declared every one of them would need a release every
41
- * time a cost factor was added. What matters is that nothing here is computed
42
- * on this side, so a new field arrives and prints without a new version.
43
- */
44
- export interface SpendReport {
45
- session: Record<string, unknown> | null;
46
- /** The per-session fold: the five cost factors and what they add to. */
47
- cost_factors: Record<string, unknown>;
48
- /** Every provider call, with its tokens, its price and the decision behind it. */
49
- calls: Record<string, unknown>[];
50
- /**
51
- * What a client should DRAW: headings, labels, ordered rows, formatted values.
52
- *
53
- * Sent by the server so that adding a cost factor, renaming one or changing
54
- * how a figure reads is a server change and never obliges a customer to
55
- * install a new version of the tool. Loosely typed on purpose, for the same
56
- * reason: a field added there must arrive here without a release.
57
- */
58
- presentation?: Record<string, unknown>;
59
- decisions: Record<string, unknown>[];
60
- units_of_work: Record<string, unknown>[];
61
- }
62
- export interface GatewayReply {
63
- /** Local transport metadata, not an authentication decision. */
64
- httpStatus?: number;
65
- intent: 'decide' | 'answer' | 'catalog' | 'store_key' | 'session' | 'job_start' | 'resolve_workspace' | 'sign_in' | 'sign_out' | 'attach' | 'transcribe' | 'graph' | 'spend' | 'project' | 'commands' | 'transcript' | 'context' | 'compact' | 'sessions' | 'permissions' | 'jobs' | 'agents' | 'integrations' | 'skills' | 'plugins' | 'schema' | 'usage' | 'instructions' | 'config' | 'memory' | 'worktrees' | 'privacy' | 'hooks' | 'queue' | 'review' | 'release' | 'decision_engine' | 'command';
66
- client: string;
67
- decision: Decision;
68
- answer: string | null;
69
- /** The receipt, already worded by the server. Clients never compose one. */
70
- receipt: string | null;
71
- /** The receipt card, worded by the server for every client. */
72
- card?: import('../agent/render').ReceiptCard | null;
73
- /** The model that actually answered. */
74
- ran_on: string | null;
75
- /** What this job cost to finish, on the model we ran. */
76
- cost_usd: number | null;
77
- /** What it would have cost on the model the caller named. */
78
- would_have_cost_usd: number | null;
79
- /** The difference. Negative means we spent more, and it is shown either way. */
80
- saved_usd: number | null;
81
- /** True when any figure rests on a coarse lookup rather than a close match. */
82
- estimated: boolean;
83
- /** Where the job opens in full, every figure traceable to its records. */
84
- details_url: string | null;
85
- /** Every vendor and model. Present only for a catalog request. */
86
- providers: CatalogProvider[];
87
- /** Whether this machine's credential was actually revoked. Present only
88
- * when signing out. */
89
- signed_out: boolean;
90
- /** Whether a key was kept. Present only when storing one. */
91
- stored: boolean;
92
- /** What happened, in words a person can act on. */
93
- message: string | null;
94
- /**
95
- * Did this workspace's build serve the intent that was asked for.
96
- *
97
- * False is a COMPLETE answer meaning "your organization is behind", never an
98
- * error and never an absence. A caller that reads it as an absence repeats
99
- * the 17 September fault: a tool asked a workspace for its vendor list, the
100
- * build did not carry that question, and the refusal was reported to the
101
- * person as "you have no keys".
102
- *
103
- * Optional, because a workspace older than this field does not send it, and
104
- * absent must read as "it answered", not as "it refused".
105
- */
106
- served?: boolean;
107
- /**
108
- * False when some part of this reply could not be established.
109
- *
110
- * An empty list in a reply with `complete: false` is NOT a list of nothing,
111
- * it is a list we failed to obtain. Reading the two the same way is the whole
112
- * of the 17 September fault, and it was present on both sides of the wire.
113
- * Optional, because a workspace older than this field does not send it, and
114
- * absent must read as "established".
115
- */
116
- complete?: boolean;
117
- /** Every intent this workspace's build does serve. Empty on an older build. */
118
- intents?: string[];
119
- /** Present only for a graph request: what the map holds, what it still needs,
120
- * or the answer to one of the five questions. */
121
- graph?: Record<string, unknown>;
122
- /**
123
- * One session's cost, worked out term by term. Present only for a spend
124
- * request.
125
- *
126
- * Shaped by the server and rendered here, never recomputed here: the whole
127
- * point of asking the service is that the terminal and the portal quote one
128
- * set of figures. A client that added anything up itself would be a second
129
- * source of truth for the one number this product sells.
130
- */
131
- spend?: SpendReport | null;
132
- /** The first line of a session, as the service wrote it (manual 2.2). */
133
- project_line?: string | null;
134
- /** The lines a project operation prints, written by the service. */
135
- lines?: string[] | null;
136
- data?: Record<string, unknown> | null;
137
- /** Present only for a context or compact request: lines to print (6.13, 6.15). */
138
- context?: {
139
- lines: string[];
140
- ok?: boolean;
141
- } | null;
142
- /** Present only for a transcript request: lines to print as sent (6.9). */
143
- transcript?: {
144
- job_id: string;
145
- lines: string[];
146
- complete: boolean;
147
- } | null;
148
- /** Present only for a jobs request (manual 5.14): lines to print as sent. */
149
- jobs?: {
150
- lines: string[];
151
- job_id?: string;
152
- running?: boolean;
153
- } | null;
154
- /** The result object a script reads (manual 10.3), built by the service. */
155
- result?: Record<string, unknown> | null;
156
- /** One reason word for a refusal, turned into a number by `exit_status`. */
157
- reason?: string | null;
158
- /** Reason word to exit number (Appendix B), as the service sends it. */
159
- exit_status?: Record<string, number> | null;
160
- /** Present only for a usage request: the figures and the lines to print. */
161
- usage?: Record<string, unknown> | null;
162
- /** Present only for a schema request: the published shape and the table. */
163
- schema_doc?: Record<string, unknown> | null;
164
- /** Present only for an agents request (manual 5.24): lines to print as sent. */
165
- agents?: {
166
- lines: string[];
167
- helpers?: Array<Record<string, unknown>>;
168
- wants?: {
169
- read?: string[];
170
- list?: string[];
171
- } | null;
172
- } | null;
173
- /** Present only for a commands request (manual 6.4, 6.5). `wants` names
174
- * the project files to send on the next round. */
175
- commands?: {
176
- items?: {
177
- name: string;
178
- description: string;
179
- source: string;
180
- }[];
181
- needs_update?: string[];
182
- keep_history?: boolean;
183
- wants?: {
184
- read?: string[];
185
- list?: string[];
186
- } | null;
187
- } | null;
188
- /** Who this machine is signed in as. Present only for a session request. */
189
- /** For sessions: `lines` to print as they are, and the records behind
190
- * them (`sessions` for a list, the one session's fields for a resume). */
191
- sessions?: SessionsReply | null;
192
- /** For permissions: `lines` to print as they are (manual 4.14). */
193
- permissions?: {
194
- lines?: string[];
195
- verdict?: string;
196
- } | null;
197
- /** For integrations: `lines` to print as they are (web manual 9.5). */
198
- integrations?: Record<string, unknown> & {
199
- lines?: string[];
200
- connections?: unknown[];
201
- } | null;
202
- /** `comprism plugins` (manual 9.15 to 9.17), in the service's words. */
203
- plugins?: Record<string, unknown> & {
204
- lines?: string[];
205
- line?: string;
206
- error?: string;
207
- } | null;
208
- /** `comprism skills` (manual 9.1 to 9.4): rows to draw, or what was saved. */
209
- skills?: {
210
- rows?: Array<{
211
- name: string;
212
- description: string;
213
- where: string;
214
- active: boolean;
215
- note?: string | null;
216
- }>;
217
- empty?: string | null;
218
- line?: string;
219
- error?: string;
220
- wants?: {
221
- read?: string[];
222
- list?: string[];
223
- } | null;
224
- } | null;
225
- session?: SessionOut | null;
226
- /** Permission for one coding job. Present only for a job_start request. */
227
- job?: JobOut | null;
228
- /** Present only for a sign_in request. */
229
- sign_in?: SignInOut | null;
230
- /** Present only for an attach or transcribe request. */
231
- upload?: UploadOut | null;
232
- /** For attach: why the file will not be read, from the service's fixed
233
- * list. The sentence is in `message`. */
234
- refusal?: string | null;
235
- /**
236
- * True when the request was understood, allowed and acted on.
237
- *
238
- * False with `served: true` is a REFUSAL carrying its reason in `message`,
239
- * and it is a complete answer. Without this a caller cannot tell "your plan
240
- * does not include this" from "this workspace has never heard of it", and
241
- * those have opposite fixes: one is a purchase, the other is a deploy.
242
- */
243
- granted?: boolean;
244
- /**
245
- * Did the workspace actually answer.
246
- *
247
- * False means we never heard from it, so EVERY other field here is this
248
- * client's own placeholder rather than anything the workspace said. Without
249
- * this a caller could not tell "the organization says you have no provider key"
250
- * from "the organization did not answer", and it read the second as the first:
251
- * somebody whose keys were all present and correct was told none was stored
252
- * and walked into a form asking them to paste one.
253
- */
254
- ok: boolean;
255
- }
256
- /** Permission to send one file, and the address to send it to. */
257
- /** One session as the service describes it (CLI manual 8.4, 8.5). */
258
- export interface SessionRecord {
259
- session_id: string;
260
- number: string;
261
- title: string;
262
- last_job_id?: string | null;
263
- continues_job?: string | null;
264
- conversation_kept?: boolean;
265
- cost_usd: number;
266
- jobs: number;
267
- /** The session as a list entry, in the service's words: name, then where and when. */
268
- card?: string[];
269
- }
270
- export interface SessionsReply extends Partial<SessionRecord> {
271
- lines: string[];
272
- sessions?: SessionRecord[];
273
- }
274
- export interface UploadOut {
275
- /** Presented at the upload address in place of the workspace credential. */
276
- ticket: string;
277
- expires_in: number;
278
- /** Named by the SERVER. A client composes no addresses of its own. */
279
- upload_path: string;
280
- }
281
- /** Permission to run one coding job, and the pass that opens its stream. */
282
- export interface JobOut {
283
- job_id: string;
284
- /**
285
- * Presented by the stream in place of the workspace credential.
286
- *
287
- * One job, one use, two minutes. The job was already authorized by the one
288
- * service before this was issued, so the stream decides nothing.
289
- */
290
- ticket: string;
291
- expires_in: number;
292
- /**
293
- * What is left of this month's included coding spend, read ONCE by the
294
- * service. The stream announces this same figure rather than reading it
295
- * again, because two readings are how a job is authorized against one number
296
- * and then tells the person watching it another.
297
- */
298
- allowance_remaining_usd: number | null;
299
- stream_path: string;
300
- }
301
- /** Everything a client's header prints, answered by the workspace in one call. */
302
- /** What signing in returns. The credential appears here once and never again. */
303
- export interface SignInOut {
304
- token: string;
305
- /**
306
- * This machine's own credential, returned ONCE.
307
- *
308
- * Nothing in the product ever returns it again, which is what makes revoking
309
- * it in the portal a meaningful act rather than a gesture.
310
- */
311
- machine_credential: string;
312
- tenant: string;
313
- /** Computed by the SERVER, never guessed by this tool. */
314
- workspace_url: string;
315
- /** True when a second factor is needed. An answer, not a failure. */
316
- needs_second_factor: boolean;
317
- challenge: string;
318
- }
319
- export interface SessionOut {
320
- signed_in: boolean;
321
- user_email: string;
322
- /** The company as a person says it, not the schema name. */
323
- company: string;
324
- tenant: string;
325
- /**
326
- * The address the workspace says it answers on, computed by the SERVER.
327
- *
328
- * Printed in preference to the address this machine happens to hold, because
329
- * a client echoing its own stored address can never tell a person that the
330
- * address is the thing that is wrong.
331
- */
332
- workspace_url: string;
333
- comparing: string;
334
- plan: string;
335
- requests_per_minute: number;
336
- requests_per_month: number;
337
- vendors_with_key: number;
338
- vendor_names: string[];
339
- /** False when the vendor lookup could not answer. The count is then meaningless. */
340
- vendors_known?: boolean;
341
- machine: string;
342
- can_write: boolean;
343
- }
344
- export interface Ask {
345
- intent: 'decide' | 'answer' | 'catalog' | 'store_key' | 'session' | 'job_start' | 'resolve_workspace' | 'sign_in' | 'sign_out' | 'attach' | 'transcribe' | 'graph' | 'spend' | 'project' | 'commands' | 'transcript' | 'context' | 'compact' | 'sessions' | 'permissions' | 'jobs' | 'agents' | 'integrations' | 'skills' | 'plugins' | 'schema' | 'usage' | 'instructions' | 'config' | 'memory' | 'worktrees' | 'privacy' | 'hooks' | 'queue' | 'review' | 'release' | 'decision_engine' | 'command';
346
- prompt: string;
347
- callingModel?: string;
348
- contextTokens?: number;
349
- freshContext?: boolean;
350
- tokensIn?: number;
351
- tokensOut?: number;
352
- /** The customer's own provider key, forwarded and never stored by us. */
353
- providerKey?: string;
354
- /** For store_key: which vendor the key belongs to. */
355
- provider?: string;
356
- /** For store_key: the key. Sent once, over TLS, and never written to disk. */
357
- key?: string;
358
- /** For job_start: rejoin this job rather than creating one. */
359
- resumeJobId?: string;
360
- /** For sign_in only. Sent once, over TLS, and written nowhere. */
361
- password?: string;
362
- /** Company login (manual 1.10): the token a browser approval issued. */
363
- deviceToken?: string;
364
- /** For sign_in, when a second factor is required. */
365
- challenge?: string;
366
- code?: string;
367
- /** For sign_in: how this machine appears where a person goes to revoke it. */
368
- machineLabel?: string;
369
- /** Which session to break down. Omitted means the newest one recorded. */
370
- spendSession?: string;
371
- /** For project: the folder facts this machine observed (manual 2.1 to 2.3). */
372
- project?: Record<string, unknown>;
373
- /** For instructions, config, memory and worktrees (manual 2.5 to 2.11). */
374
- op?: string;
375
- payload?: Record<string, unknown>;
376
- /** For commands: the session words this tool runs, and the project files
377
- * the service asked for on the previous round. */
378
- commandsPayload?: Record<string, unknown>;
379
- sessionsPayload?: Record<string, unknown>;
380
- /** For jobs: op (list, find, stop) and job (manual 5.14). */
381
- jobsPayload?: Record<string, unknown>;
382
- /** For agents: the helper definition files this machine read (manual 5.24). */
383
- agentsPayload?: Record<string, unknown>;
384
- /** For usage: this machine's offset from UTC in minutes (manual 10.12). */
385
- tzMinutes?: number;
386
- skillsPayload?: Record<string, unknown>;
387
- integrationsPayload?: Record<string, unknown>;
388
- pluginsPayload?: Record<string, unknown>;
389
- /** For permissions: op, action, target and the settings files (manual 4.14). */
390
- permissionsPayload?: Record<string, unknown>;
391
- /** For transcript: the job whose record to print (manual 6.9). */
392
- jobId?: string;
393
- /** For graph: which of the map's operations this is. */
394
- graphOp?: 'status' | 'stamps' | 'update' | 'finish' | 'ask' | 'forget' | 'policy';
395
- /** For graph: the project on this machine the map belongs to. */
396
- workspace?: string;
397
- /**
398
- * For graph: the facts read from this machine's own files, or the question
399
- * being asked of the map.
400
- *
401
- * **Structure only, never source.** What travels is "a function called
402
- * price_of exists at line 40 of this file, and these things call it". What
403
- * that function SAYS never leaves the machine, and there is no field here
404
- * that could carry it.
405
- */
406
- graphPayload?: Record<string, unknown>;
407
- /** For attach: the file's name and size, asked about before its bytes are
408
- * sent. Never its contents (manual 3.10). */
409
- attachment?: {
410
- filename: string;
411
- size_bytes: number;
412
- };
413
- /** For answer: ids of files already attached, read before the question. */
414
- attachments?: string[];
415
- }
416
- /**
417
- * The same door, at an address this machine is not signed in to yet.
418
- *
419
- * Signing in is the one thing that cannot present a credential, because it is
420
- * what mints one. So it needs a way to reach the door before a connection file
421
- * exists. Everything else about the call is identical, which is the point: one
422
- * door, and the credential is a header on it rather than a different address.
423
- */
424
- export declare function askAt(url: string, input: Ask, tenant?: string): Promise<GatewayReply>;
425
- export declare function ask(input: Ask): Promise<GatewayReply>;
426
- /** A sentence for a certificate failure, or null when the failure was not one. */
427
- export declare function certificateProblem(e: unknown): string | null;