@andorra-labs/code 0.1.16 → 0.1.18

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 (236) hide show
  1. package/dist/src/acp-agent.d.ts +6 -0
  2. package/dist/src/acp-agent.js +15 -4
  3. package/dist/src/agent-execution.js +108 -19
  4. package/dist/src/agent-mcp-catalog.js +1 -0
  5. package/dist/src/agent-mcp.d.ts +3 -0
  6. package/dist/src/agent-mcp.js +33 -1
  7. package/dist/src/andorra/entry.d.ts +10 -0
  8. package/dist/src/andorra/entry.js +18 -4
  9. package/dist/src/andorra/errors.js +3 -0
  10. package/dist/src/andorra/hosted.d.ts +2 -1
  11. package/dist/src/andorra/hosted.js +2 -1
  12. package/dist/src/andorra/notices.d.ts +5 -0
  13. package/dist/src/andorra/notices.js +7 -0
  14. package/dist/src/andorra/state.d.ts +3 -2
  15. package/dist/src/andorra/state.js +4 -4
  16. package/dist/src/andorra/terminal.js +7 -2
  17. package/dist/src/anthropic-credentials.js +2 -0
  18. package/dist/src/app-server/error.d.ts +5 -0
  19. package/dist/src/app-server/error.js +7 -0
  20. package/dist/src/app-server/protocol.d.ts +30 -44
  21. package/dist/src/app-server/protocol.js +5 -1
  22. package/dist/src/app-server/workspace.d.ts +108 -0
  23. package/dist/src/app-server/workspace.js +608 -11
  24. package/dist/src/app-server.d.ts +390 -33
  25. package/dist/src/app-server.js +3033 -565
  26. package/dist/src/attachments.d.ts +10 -0
  27. package/dist/src/attachments.js +102 -7
  28. package/dist/src/automation-tool.js +2 -1
  29. package/dist/src/bridge/cloud.d.ts +27 -0
  30. package/dist/src/bridge/cloud.js +187 -0
  31. package/dist/src/bridge/command.d.ts +30 -0
  32. package/dist/src/bridge/command.js +359 -0
  33. package/dist/src/bridge/control.d.ts +70 -0
  34. package/dist/src/bridge/control.js +238 -0
  35. package/dist/src/bridge/engines.d.ts +90 -0
  36. package/dist/src/bridge/engines.js +601 -0
  37. package/dist/src/bridge/github.d.ts +108 -0
  38. package/dist/src/bridge/github.js +378 -0
  39. package/dist/src/bridge/host-ops.d.ts +9 -0
  40. package/dist/src/bridge/host-ops.js +139 -0
  41. package/dist/src/bridge/host.d.ts +47 -0
  42. package/dist/src/bridge/host.js +543 -0
  43. package/dist/src/bridge/link.d.ts +38 -0
  44. package/dist/src/bridge/link.js +508 -0
  45. package/dist/src/bridge/login-link.d.ts +29 -0
  46. package/dist/src/bridge/login-link.js +54 -0
  47. package/dist/src/bridge/protocol.d.ts +136 -0
  48. package/dist/src/bridge/protocol.js +11 -0
  49. package/dist/src/bridge/store.d.ts +12 -0
  50. package/dist/src/bridge/store.js +61 -0
  51. package/dist/src/bridge/wording.d.ts +6 -0
  52. package/dist/src/bridge/wording.js +10 -0
  53. package/dist/src/browser-server.js +7 -1
  54. package/dist/src/browser-ui/tokens.css +1 -1
  55. package/dist/src/bug-report-attachments.d.ts +48 -0
  56. package/dist/src/bug-report-attachments.js +327 -0
  57. package/dist/src/bug-report.d.ts +23 -3
  58. package/dist/src/bug-report.js +72 -9
  59. package/dist/src/change-authors.d.ts +41 -0
  60. package/dist/src/change-authors.js +146 -0
  61. package/dist/src/cli.d.ts +1 -3
  62. package/dist/src/cli.js +191 -35
  63. package/dist/src/codex-provider.js +1 -1
  64. package/dist/src/coding-tools.js +24 -17
  65. package/dist/src/command-screens.d.ts +6 -0
  66. package/dist/src/command-screens.js +14 -11
  67. package/dist/src/commands.d.ts +15 -3
  68. package/dist/src/commands.js +2 -1
  69. package/dist/src/compaction-phrases.js +1 -1
  70. package/dist/src/completion.js +89 -8
  71. package/dist/src/config.d.ts +71 -3
  72. package/dist/src/config.js +205 -78
  73. package/dist/src/context-budget.js +15 -2
  74. package/dist/src/deadline.js +13 -1
  75. package/dist/src/decision/DecisionEngine.d.ts +2 -0
  76. package/dist/src/decision/DecisionManager.d.ts +11 -0
  77. package/dist/src/decision/DecisionManager.js +36 -0
  78. package/dist/src/decision/applyTaskKind.d.ts +8 -0
  79. package/dist/src/decision/applyTaskKind.js +53 -0
  80. package/dist/src/decision/checks.js +1 -1
  81. package/dist/src/decision/hostedPolicy.js +2 -1
  82. package/dist/src/decision/providers/AndorraDecisionProvider.d.ts +2 -0
  83. package/dist/src/decision/providers/AndorraDecisionProvider.js +12 -0
  84. package/dist/src/decision/requestPhrases.js +0 -1
  85. package/dist/src/decision/taskKind.d.ts +52 -0
  86. package/dist/src/decision/taskKind.js +76 -0
  87. package/dist/src/decision/types.d.ts +1 -1
  88. package/dist/src/default-graph.js +1 -1
  89. package/dist/src/efficiency.d.ts +5 -0
  90. package/dist/src/efficiency.js +5 -1
  91. package/dist/src/effort-routing.d.ts +27 -0
  92. package/dist/src/effort-routing.js +34 -0
  93. package/dist/src/evidence.d.ts +110 -0
  94. package/dist/src/evidence.js +195 -0
  95. package/dist/src/file-diff.d.ts +4 -0
  96. package/dist/src/file-diff.js +2 -1
  97. package/dist/src/github-app/agent-writes.d.ts +102 -0
  98. package/dist/src/github-app/agent-writes.js +320 -0
  99. package/dist/src/github-app/client.d.ts +368 -0
  100. package/dist/src/github-app/client.js +830 -0
  101. package/dist/src/github-app/event-source.d.ts +208 -0
  102. package/dist/src/github-app/event-source.js +684 -0
  103. package/dist/src/github-app/metrics.d.ts +32 -0
  104. package/dist/src/github-app/metrics.js +49 -0
  105. package/dist/src/github-app/review-loop.d.ts +274 -0
  106. package/dist/src/github-app/review-loop.js +1177 -0
  107. package/dist/src/github-app/review-node.d.ts +81 -0
  108. package/dist/src/github-app/review-node.js +205 -0
  109. package/dist/src/github-app/review-post.d.ts +73 -0
  110. package/dist/src/github-app/review-post.js +139 -0
  111. package/dist/src/github-app/review-text.d.ts +107 -0
  112. package/dist/src/github-app/review-text.js +1133 -0
  113. package/dist/src/github-app/review-threads.d.ts +47 -0
  114. package/dist/src/github-app/review-threads.js +107 -0
  115. package/dist/src/github-app/reviewer.d.ts +121 -0
  116. package/dist/src/github-app/reviewer.js +598 -0
  117. package/dist/src/github-app/store.d.ts +59 -0
  118. package/dist/src/github-app/store.js +148 -0
  119. package/dist/src/github-app/triggers.d.ts +141 -0
  120. package/dist/src/github-app/triggers.js +441 -0
  121. package/dist/src/github-names.d.ts +15 -0
  122. package/dist/src/github-names.js +15 -0
  123. package/dist/src/glob-search.d.ts +61 -0
  124. package/dist/src/glob-search.js +180 -0
  125. package/dist/src/graph-health.js +6 -1
  126. package/dist/src/graph-manager-chat.js +1 -1
  127. package/dist/src/graph-preview.d.ts +48 -0
  128. package/dist/src/graph-preview.js +56 -0
  129. package/dist/src/graph-provider-portability.js +2 -1
  130. package/dist/src/graph-runner.js +65 -4
  131. package/dist/src/graph-server.js +7 -5
  132. package/dist/src/graph-sync.js +3 -3
  133. package/dist/src/graph-ui/app.js +121 -7
  134. package/dist/src/graph-ui/icons.js +2 -1
  135. package/dist/src/graph-ui/studio.js +15 -1
  136. package/dist/src/graph-ui/tokens.css +1 -1
  137. package/dist/src/graphs.d.ts +40 -1
  138. package/dist/src/graphs.js +164 -15
  139. package/dist/src/hardened-runtime.js +32 -21
  140. package/dist/src/image-input.d.ts +16 -0
  141. package/dist/src/image-input.js +41 -0
  142. package/dist/src/membership.d.ts +10 -0
  143. package/dist/src/membership.js +19 -4
  144. package/dist/src/model-health-cache.js +1 -1
  145. package/dist/src/model-metadata.d.ts +6 -0
  146. package/dist/src/model-metadata.js +35 -15
  147. package/dist/src/model-override.d.ts +2 -1
  148. package/dist/src/model-override.js +9 -0
  149. package/dist/src/model-relay/local.d.ts +116 -0
  150. package/dist/src/model-relay/local.js +468 -0
  151. package/dist/src/model-relay/remote.d.ts +129 -0
  152. package/dist/src/model-relay/remote.js +252 -0
  153. package/dist/src/model-relay/runs.d.ts +34 -0
  154. package/dist/src/model-relay/runs.js +146 -0
  155. package/dist/src/model-relay/wire.d.ts +5 -0
  156. package/dist/src/model-relay/wire.js +5 -0
  157. package/dist/src/model-tiers.d.ts +3 -0
  158. package/dist/src/model-tiers.js +3 -3
  159. package/dist/src/project-registry.d.ts +21 -0
  160. package/dist/src/project-registry.js +74 -0
  161. package/dist/src/provider-engine.d.ts +13 -1
  162. package/dist/src/provider-engine.js +74 -0
  163. package/dist/src/provider-import.d.ts +0 -12
  164. package/dist/src/provider-import.js +7 -195
  165. package/dist/src/providers.d.ts +28 -2
  166. package/dist/src/providers.js +59 -12
  167. package/dist/src/pull-request-logs.d.ts +12 -1
  168. package/dist/src/pull-request-logs.js +14 -3
  169. package/dist/src/pull-requests.d.ts +338 -8
  170. package/dist/src/pull-requests.js +482 -53
  171. package/dist/src/react-runtime.js +99 -16
  172. package/dist/src/remote/engine-pool.d.ts +88 -4
  173. package/dist/src/remote/engine-pool.js +367 -90
  174. package/dist/src/remote/roots.d.ts +19 -0
  175. package/dist/src/remote/roots.js +45 -7
  176. package/dist/src/remote/types.d.ts +0 -44
  177. package/dist/src/run-control.d.ts +7 -0
  178. package/dist/src/run-control.js +23 -0
  179. package/dist/src/run-records.d.ts +7 -2
  180. package/dist/src/run-records.js +71 -6
  181. package/dist/src/runtime.d.ts +34 -2
  182. package/dist/src/runtime.js +18 -2
  183. package/dist/src/session-changes.d.ts +35 -0
  184. package/dist/src/session-changes.js +194 -6
  185. package/dist/src/session-monitor.js +2 -1
  186. package/dist/src/session-reaper.d.ts +1 -1
  187. package/dist/src/session-reaper.js +6 -1
  188. package/dist/src/session-summary.d.ts +2 -1
  189. package/dist/src/session-summary.js +2 -1
  190. package/dist/src/sessions.d.ts +35 -1
  191. package/dist/src/sessions.js +70 -4
  192. package/dist/src/skills/bundled/bug-report/SKILL.md +51 -7
  193. package/dist/src/skills/bundled/diagram/SKILL.md +5 -3
  194. package/dist/src/skills/bundled/graph-manager/SKILL.md +7 -4
  195. package/dist/src/skills/bundled/provenance.json +3 -3
  196. package/dist/src/skills/runtime-skills.js +1 -1
  197. package/dist/src/task-checkout.d.ts +141 -0
  198. package/dist/src/task-checkout.js +558 -0
  199. package/dist/src/telemetry/emitter.d.ts +15 -0
  200. package/dist/src/telemetry/emitter.js +35 -1
  201. package/dist/src/telemetry/schema.d.ts +25 -2
  202. package/dist/src/telemetry/schema.js +52 -4
  203. package/dist/src/telemetry/surface.d.ts +2 -1
  204. package/dist/src/telemetry/surface.js +4 -1
  205. package/dist/src/terminal-ui.d.ts +1 -0
  206. package/dist/src/terminal-ui.js +10 -3
  207. package/dist/src/test-edit-guard.d.ts +37 -0
  208. package/dist/src/test-edit-guard.js +216 -3
  209. package/dist/src/thinking-level-detect.d.ts +11 -0
  210. package/dist/src/thinking-level-detect.js +47 -0
  211. package/dist/src/thinking-levels.d.ts +30 -0
  212. package/dist/src/thinking-levels.js +124 -0
  213. package/dist/src/timers.d.ts +3 -0
  214. package/dist/src/tool-catalog.js +1 -1
  215. package/dist/src/tools.js +59 -9
  216. package/dist/src/transcript.js +1 -1
  217. package/dist/src/types.d.ts +34 -0
  218. package/package.json +6 -1
  219. package/dist/src/remote/cert.d.ts +0 -11
  220. package/dist/src/remote/cert.js +0 -87
  221. package/dist/src/remote/client.d.ts +0 -119
  222. package/dist/src/remote/client.js +0 -544
  223. package/dist/src/remote/command.d.ts +0 -4
  224. package/dist/src/remote/command.js +0 -194
  225. package/dist/src/remote/errors.d.ts +0 -11
  226. package/dist/src/remote/errors.js +0 -14
  227. package/dist/src/remote/network.d.ts +0 -22
  228. package/dist/src/remote/network.js +0 -102
  229. package/dist/src/remote/pairing.d.ts +0 -63
  230. package/dist/src/remote/pairing.js +0 -299
  231. package/dist/src/remote/pem.d.ts +0 -2
  232. package/dist/src/remote/pem.js +0 -7
  233. package/dist/src/remote/serve.d.ts +0 -68
  234. package/dist/src/remote/serve.js +0 -244
  235. package/dist/src/remote/server.d.ts +0 -21
  236. package/dist/src/remote/server.js +0 -406
@@ -1,8 +1,8 @@
1
1
  import { changeConfigFile, loadConfig, reconcileSubagentPair } from '../config.js';
2
2
  import { ANDORRA_CHANGED_MESSAGE } from './endpoint.js';
3
- import { fallbackProviderId, hasAndorraEntry, virtualAndorraEntry } from './entry.js';
3
+ import { andorraModelSwitch, fallbackProviderId, hasAndorraEntry, virtualAndorraEntry } from './entry.js';
4
4
  import { HostedMonitor } from './monitor.js';
5
- import { ANDORRA_ADD_HINT, andorraAnnouncement, speechBubble } from './notices.js';
5
+ import { ANDORRA_ADD_HINT, andorraAnnouncement, andorraModelSwitched, speechBubble } from './notices.js';
6
6
  import { addAndorraEntry, saveAndorraAnswer } from './opt-in.js';
7
7
  import { readHostedState, recordAndorraRemoved } from './state.js';
8
8
  /** The ids of the providers that serve Andorra's hosted models: the footer shows the usage while one of them is in play. */
@@ -81,7 +81,12 @@ export function createTerminalAndorra(options) {
81
81
  // Written or not, take the entry as the file has it, so one another client added or removed shows here.
82
82
  const saved = await saveAndorraAnswer(directory, answer) ?? await loadConfig(directory);
83
83
  const before = JSON.stringify([config.providers.find(provider => provider.type === 'andorra'), config.provider]);
84
+ const held = { providers: structuredClone(config.providers.filter(provider => provider.type === 'andorra')) };
84
85
  adoptAndorraEntry(config, saved);
86
+ // The model this terminal was on left the offer, whichever client saved the move: say which one it is on now.
87
+ const moved = andorraModelSwitch(held, config);
88
+ if (moved !== undefined && config.provider === moved.id)
89
+ options.print(andorraModelSwitched(moved.from, moved.to));
85
90
  if (JSON.stringify([config.providers.find(provider => provider.type === 'andorra'), config.provider]) !== before)
86
91
  options.refreshStatus();
87
92
  },
@@ -40,6 +40,8 @@ export function signInRequired(providerId) {
40
40
  }
41
41
  const REFRESH_FAILED = 'Your Claude Console sign-in expired or could not be refreshed. Sign in again.';
42
42
  export async function providerAuthHeaders(provider, options = {}) {
43
+ if (provider.type === 'relayed')
44
+ throw new Error('A relayed provider needs a run.');
43
45
  if (provider.type === 'andorra') {
44
46
  assertProviderCredentials(provider);
45
47
  const token = await andorraAccessToken(options.signal);
@@ -0,0 +1,5 @@
1
+ import type { AppServerErrorCode } from './protocol.js';
2
+ export declare class AppServerError extends Error {
3
+ readonly code: AppServerErrorCode;
4
+ constructor(code: AppServerErrorCode, message: string);
5
+ }
@@ -0,0 +1,7 @@
1
+ export class AppServerError extends Error {
2
+ code;
3
+ constructor(code, message) {
4
+ super(message);
5
+ this.code = code;
6
+ }
7
+ }
@@ -1,5 +1,10 @@
1
+ import type { SessionCheckout } from '../task-checkout.js';
1
2
  export declare const APP_SERVER_PROTOCOL_VERSION = 2;
2
- export declare const APP_SERVER_CAPABILITIES: readonly ["run.start.runPermissions", "automations", "providers.models", "providers.test", "providers.test.model", "providers.streamIdleTimeout", "providers.modelContextWindows", "providers.name", "providers.claude", "providers.claudeAuth", "providers.grok", "providers.google", "providers.opencode", "providers.auth.submit", "providers.opencodeGo", "providers.discover.draft", "providers.detectSignIns", "providers.codexAuth", "providers.codexAuth.logout", "providers.codexAccounts", "providers.anthropicConsole", "run.resume.direction", "run.resume.model", "run.resume.compact", "run.steer", "run.overrideAllNodes", "run.setModel", "run.setModel.node", "run.setPermissions", "run.start.continueSession", "run.start.entryHistory", "remote.owner.projects", "remote.workspaces.probe", "remote.engine.relay", "remote.hosting.device.grant", "extensions.manage", "extensions.resources", "skills.invoke", "mcp.manage", "mcp.edit", "mcp.status", "runs.files", "sessions.files", "account.profile", "sessions.stats", "sessions.usage", "sessions.usage.hourly", "config.analytics", "config.analytics.planGate", "sessions.trajectory", "config.externalSubagent", "config.codeIntel", "config.decisions", "browser.view", "attachments.read", "config.general", "sessions.pullRequest", "sessions.pullRequest.details", "sessions.pullRequest.review", "sessions.pullRequest.review.teams", "sessions.pullRequest.merge", "sessions.pullRequest.create", "sessions.pullRequest.conversation", "sessions.pullRequest.suggestions", "sessions.pullRequest.checkLogs", "sessions.pullRequest.edit", "sessions.pullRequest.mergeQueue", "sessions.pullRequest.merge.bypass", "sessions.pullRequest.create.fork", "sessions.pullRequest.attach", "pullRequests.reviewRequests", "issues.list", "browser.view.go", "config.browser", "config.webSearch", "background.tasks", "workspace.warm", "browser.cookies.firefox", "browser.extensions", "sessions.compact", "sessions.goal", "sessions.changes", "run.current", "sessions.jev", "providers.andorra", "graphs.visibility"];
3
+ export declare const APP_SERVER_CAPABILITIES: readonly ["run.start.runPermissions", "model.relay", "automations", "providers.models", "providers.test", "providers.test.model", "providers.thinkingLevels", "providers.streamIdleTimeout", "providers.modelContextWindows", "providers.textOnlyModels", "providers.name", "providers.claude", "providers.claudeAuth", "providers.grok", "providers.google", "providers.opencode", "providers.auth.submit", "providers.opencodeGo", "providers.discover.draft", "providers.detectSignIns", "providers.codexAuth", "providers.codexAuth.logout", "providers.codexAccounts", "providers.anthropicConsole", "run.resume.direction", "run.resume.model", "run.resume.compact", "run.steer", "run.overrideAllNodes", "run.setModel", "run.setModel.node", "run.setPermissions", "run.start.continueSession", "run.start.entryHistory", "remote.owner.projects", "remote.engine.relay", "environments.bridge", "environments.cloud", "extensions.manage", "extensions.resources", "skills.invoke", "mcp.manage", "mcp.edit", "mcp.status", "runs.files", "sessions.files", "account.profile", "sessions.stats", "sessions.usage", "sessions.usage.hourly", "config.analytics", "config.analytics.planGate", "sessions.trajectory", "config.externalSubagent", "config.codeIntel", "config.decisions", "browser.view", "attachments.read", "config.general", "sessions.pullRequest", "sessions.pullRequest.details", "sessions.pullRequest.review", "sessions.pullRequest.review.teams", "sessions.pullRequest.merge", "sessions.pullRequest.create", "sessions.pullRequest.conversation", "sessions.pullRequest.suggestions", "sessions.pullRequest.checkLogs", "sessions.pullRequest.edit", "sessions.pullRequest.mergeQueue", "sessions.pullRequest.merge.bypass", "sessions.pullRequest.create.fork", "sessions.pullRequest.attach", "pullRequests.reviewRequests", "issues.list", "browser.view.go", "config.browser", "config.webSearch", "background.tasks", "workspace.warm", "browser.cookies.firefox", "browser.extensions", "sessions.compact", "sessions.goal", "sessions.changes", "run.current", "sessions.jev", "providers.andorra", "graphs.visibility", "github.app", "github.app.agentWrites", "github.app.triggers", "github.app.reviews", "github.app.repositories", "sessions.pin", "workspace.files", "workspace.search", "workspace.linkBase", "workspace.write", "sessions.changes.authors", "run.note", "workspace.image", "workspace.taskCheckout", "sessions.review"];
4
+ /** Remote engine events about the engine version a desktop runs, sent to every connection of that version. */
5
+ export declare const REMOTE_ENGINE_INSTALLING_EVENT = "remote.engine.installing";
6
+ export declare const REMOTE_ENGINE_READY_EVENT = "remote.engine.ready";
7
+ export declare const REMOTE_ENGINE_INSTALL_FAILED_EVENT = "remote.engine.install-failed";
3
8
  export interface AppServerRequest {
4
9
  id: number | string;
5
10
  method: string;
@@ -33,7 +38,7 @@ export interface AppServerHostInfo {
33
38
  running?: boolean;
34
39
  capabilities: readonly string[];
35
40
  }
36
- export type AppServerErrorCode = 'invalid-request' | 'unknown-method' | 'invalid-params' | 'busy' | 'engine-busy' | 'not-found' | 'login-required' | 'auth' | 'storage' | 'network' | 'cancelled' | 'internal' | 'remote' | 'nothing-to-continue';
41
+ export type AppServerErrorCode = 'invalid-request' | 'unknown-method' | 'invalid-params' | 'busy' | 'engine-busy' | 'not-found' | 'login-required' | 'auth' | 'storage' | 'network' | 'cancelled' | 'internal' | 'remote' | 'nothing-to-continue' | 'forbidden' | 'checkout-missing';
37
42
  export type AppServerPermissionMode = 'read-only' | 'plan' | 'ask-for-approval' | 'approve-for-me' | 'full-access';
38
43
  export interface AppServerProviderAuth {
39
44
  state: 'signedOut' | 'starting' | 'waiting' | 'signedIn' | 'cancelled' | 'error';
@@ -67,7 +72,7 @@ export interface AppServerProviderAuth {
67
72
  }
68
73
  export interface AppServerProvider {
69
74
  id: string;
70
- type: 'openai-compatible' | 'anthropic' | 'codex' | 'claude' | 'opencode-go' | 'grok' | 'opencode' | 'google' | 'andorra';
75
+ type: 'openai-compatible' | 'anthropic' | 'codex' | 'claude' | 'opencode-go' | 'grok' | 'opencode' | 'google' | 'andorra' | 'relayed';
71
76
  baseUrl: string;
72
77
  model: string;
73
78
  apiKeyEnv?: string;
@@ -241,6 +246,7 @@ export interface AppServerUsageAnalytics {
241
246
  /** 1 is the rolling last 24 hours, whose `days` rows are UTC hours keyed "YYYY-MM-DDTHH"; otherwise UTC dates. */
242
247
  windowDays: number;
243
248
  }
249
+ /** `author` marks an added or removed line of a file the person also edited: `user` for theirs, `agent` for the agent's. */
244
250
  export interface AppServerFileDiffLine {
245
251
  kind: 'context' | 'add' | 'del';
246
252
  text: string;
@@ -248,6 +254,7 @@ export interface AppServerFileDiffLine {
248
254
  newLine?: number;
249
255
  noNewline?: true;
250
256
  clipped?: true;
257
+ author?: 'agent' | 'user';
251
258
  }
252
259
  export interface AppServerFileDiffHunk {
253
260
  oldStart: number;
@@ -276,6 +283,8 @@ export interface AppServerSessionFileChange {
276
283
  to: 'lf' | 'crlf' | 'mixed';
277
284
  };
278
285
  changedOnDisk?: true;
286
+ /** Saved from the Files tab: `only` when the person alone changed the file, `also` when the agent changed it too. */
287
+ editedByUser?: 'only' | 'also';
279
288
  undoable: boolean;
280
289
  version: number;
281
290
  firstChangedAt: string;
@@ -287,10 +296,12 @@ export interface AppServerSessionChanges {
287
296
  revision: number;
288
297
  changes: AppServerSessionFileChange[];
289
298
  }
299
+ /** `userLines`, on a `user-edited` conflict, are the person's lines in the file now, as inclusive ranges. */
290
300
  export interface AppServerSessionChangeConflict {
291
301
  path: string;
292
- reason: 'changed-on-disk' | 'no-baseline';
302
+ reason: 'changed-on-disk' | 'no-baseline' | 'user-edited';
293
303
  message: string;
304
+ userLines?: [number, number][];
294
305
  }
295
306
  export interface AppServerSessionChangesKept extends AppServerSessionChanges {
296
307
  kept: string[];
@@ -313,7 +324,18 @@ export interface AppServerSessionSummary {
313
324
  turns: number;
314
325
  lastTask?: string;
315
326
  archived?: boolean;
327
+ pinned?: boolean;
316
328
  jevEnabled?: boolean;
329
+ /** Where the task works: its own worktree, or the project folder. */
330
+ checkout?: SessionCheckout;
331
+ /** The newest completed turn waiting for review in Needs you, and when it was marked reviewed. */
332
+ review?: {
333
+ runId: string;
334
+ finishedAt: string;
335
+ reviewedAt?: string;
336
+ headline?: string;
337
+ unverified?: string[];
338
+ };
317
339
  lastTurnStatus?: AppServerTurnStatus;
318
340
  timers?: AppServerTimerState[];
319
341
  usage: {
@@ -360,22 +382,26 @@ export interface AppServerGraphSummary {
360
382
  locked?: boolean;
361
383
  updatedAt?: string;
362
384
  }
385
+ /** `ignored`: Git ignores the entry, or it sits inside a folder Git ignores. Absent outside a repository or when Git could not say. */
363
386
  export interface AppServerTreeEntry {
364
387
  name: string;
365
388
  path: string;
366
389
  type: 'file' | 'directory';
367
390
  size?: number;
391
+ ignored?: boolean;
368
392
  }
369
393
  export interface AppServerGitFile {
370
394
  path: string;
371
395
  index: string;
372
396
  worktree: string;
373
397
  }
398
+ /** `prefix`: where the project folder sits in its repository (`app/`), when it is not the repository's top; `files` are named from the top. */
374
399
  export interface AppServerGitStatus {
375
400
  repository: boolean;
376
401
  branch?: string;
377
402
  files: AppServerGitFile[];
378
403
  truncated?: boolean;
404
+ prefix?: string;
379
405
  }
380
406
  export interface AppServerBranchList {
381
407
  repository: boolean;
@@ -398,51 +424,11 @@ export interface AppServerBundle {
398
424
  relativePath?: string;
399
425
  command?: string;
400
426
  }
401
- export type AppServerRemoteTransport = 'https' | 'http';
402
427
  export interface AppServerProject {
403
428
  path: string;
404
429
  name?: string;
405
430
  addedAt: string;
406
431
  }
407
- export interface AppServerRemoteHostingStatus {
408
- serving: boolean;
409
- port: number;
410
- transport: AppServerRemoteTransport;
411
- hostname: string;
412
- fingerprint: string;
413
- code: string | null;
414
- invitationExpiresAt: string | null;
415
- invitationGrant?: 'browse' | 'full';
416
- devices: {
417
- id: string;
418
- label?: string;
419
- addedAt: string;
420
- lastSeenAt?: string;
421
- grant?: 'browse' | 'full';
422
- }[];
423
- shares: {
424
- id: string;
425
- path: string;
426
- label?: string;
427
- }[];
428
- }
429
- export interface AppServerRemoteWorkspace {
430
- id: string;
431
- nickname: string;
432
- host: string;
433
- hosts: string[];
434
- port: number;
435
- transport: AppServerRemoteTransport;
436
- fingerprint: string;
437
- hostname?: string;
438
- platform?: string;
439
- version?: string;
440
- addedAt: string;
441
- status: 'online' | 'offline' | 'identity-changed' | 'unauthorized' | 'unknown';
442
- grant?: 'browse' | 'full';
443
- relay?: boolean;
444
- statusDetail?: string;
445
- }
446
432
  export interface AppServerRemoteProject {
447
433
  rootId: string;
448
434
  name: string;
@@ -1,2 +1,6 @@
1
1
  export const APP_SERVER_PROTOCOL_VERSION = 2;
2
- export const APP_SERVER_CAPABILITIES = ['run.start.runPermissions', 'automations', 'providers.models', 'providers.test', 'providers.test.model', 'providers.streamIdleTimeout', 'providers.modelContextWindows', 'providers.name', 'providers.claude', 'providers.claudeAuth', 'providers.grok', 'providers.google', 'providers.opencode', 'providers.auth.submit', 'providers.opencodeGo', 'providers.discover.draft', 'providers.detectSignIns', 'providers.codexAuth', 'providers.codexAuth.logout', 'providers.codexAccounts', 'providers.anthropicConsole', 'run.resume.direction', 'run.resume.model', 'run.resume.compact', 'run.steer', 'run.overrideAllNodes', 'run.setModel', 'run.setModel.node', 'run.setPermissions', 'run.start.continueSession', 'run.start.entryHistory', 'remote.owner.projects', 'remote.workspaces.probe', 'remote.engine.relay', 'remote.hosting.device.grant', 'extensions.manage', 'extensions.resources', 'skills.invoke', 'mcp.manage', 'mcp.edit', 'mcp.status', 'runs.files', 'sessions.files', 'account.profile', 'sessions.stats', 'sessions.usage', 'sessions.usage.hourly', 'config.analytics', 'config.analytics.planGate', 'sessions.trajectory', 'config.externalSubagent', 'config.codeIntel', 'config.decisions', 'browser.view', 'attachments.read', 'config.general', 'sessions.pullRequest', 'sessions.pullRequest.details', 'sessions.pullRequest.review', 'sessions.pullRequest.review.teams', 'sessions.pullRequest.merge', 'sessions.pullRequest.create', 'sessions.pullRequest.conversation', 'sessions.pullRequest.suggestions', 'sessions.pullRequest.checkLogs', 'sessions.pullRequest.edit', 'sessions.pullRequest.mergeQueue', 'sessions.pullRequest.merge.bypass', 'sessions.pullRequest.create.fork', 'sessions.pullRequest.attach', 'pullRequests.reviewRequests', 'issues.list', 'browser.view.go', 'config.browser', 'config.webSearch', 'background.tasks', 'workspace.warm', 'browser.cookies.firefox', 'browser.extensions', 'sessions.compact', 'sessions.goal', 'sessions.changes', 'run.current', 'sessions.jev', 'providers.andorra', 'graphs.visibility'];
2
+ export const APP_SERVER_CAPABILITIES = ['run.start.runPermissions', 'model.relay', 'automations', 'providers.models', 'providers.test', 'providers.test.model', 'providers.thinkingLevels', 'providers.streamIdleTimeout', 'providers.modelContextWindows', 'providers.textOnlyModels', 'providers.name', 'providers.claude', 'providers.claudeAuth', 'providers.grok', 'providers.google', 'providers.opencode', 'providers.auth.submit', 'providers.opencodeGo', 'providers.discover.draft', 'providers.detectSignIns', 'providers.codexAuth', 'providers.codexAuth.logout', 'providers.codexAccounts', 'providers.anthropicConsole', 'run.resume.direction', 'run.resume.model', 'run.resume.compact', 'run.steer', 'run.overrideAllNodes', 'run.setModel', 'run.setModel.node', 'run.setPermissions', 'run.start.continueSession', 'run.start.entryHistory', 'remote.owner.projects', 'remote.engine.relay', 'environments.bridge', 'environments.cloud', 'extensions.manage', 'extensions.resources', 'skills.invoke', 'mcp.manage', 'mcp.edit', 'mcp.status', 'runs.files', 'sessions.files', 'account.profile', 'sessions.stats', 'sessions.usage', 'sessions.usage.hourly', 'config.analytics', 'config.analytics.planGate', 'sessions.trajectory', 'config.externalSubagent', 'config.codeIntel', 'config.decisions', 'browser.view', 'attachments.read', 'config.general', 'sessions.pullRequest', 'sessions.pullRequest.details', 'sessions.pullRequest.review', 'sessions.pullRequest.review.teams', 'sessions.pullRequest.merge', 'sessions.pullRequest.create', 'sessions.pullRequest.conversation', 'sessions.pullRequest.suggestions', 'sessions.pullRequest.checkLogs', 'sessions.pullRequest.edit', 'sessions.pullRequest.mergeQueue', 'sessions.pullRequest.merge.bypass', 'sessions.pullRequest.create.fork', 'sessions.pullRequest.attach', 'pullRequests.reviewRequests', 'issues.list', 'browser.view.go', 'config.browser', 'config.webSearch', 'background.tasks', 'workspace.warm', 'browser.cookies.firefox', 'browser.extensions', 'sessions.compact', 'sessions.goal', 'sessions.changes', 'run.current', 'sessions.jev', 'providers.andorra', 'graphs.visibility', 'github.app', 'github.app.agentWrites', 'github.app.triggers', 'github.app.reviews', 'github.app.repositories', 'sessions.pin', 'workspace.files', 'workspace.search', 'workspace.linkBase', 'workspace.write', 'sessions.changes.authors', 'run.note', 'workspace.image', 'workspace.taskCheckout', 'sessions.review'];
3
+ /** Remote engine events about the engine version a desktop runs, sent to every connection of that version. */
4
+ export const REMOTE_ENGINE_INSTALLING_EVENT = 'remote.engine.installing';
5
+ export const REMOTE_ENGINE_READY_EVENT = 'remote.engine.ready';
6
+ export const REMOTE_ENGINE_INSTALL_FAILED_EVENT = 'remote.engine.install-failed';
@@ -11,11 +11,45 @@ export declare function readTree(root: string, options?: {
11
11
  entries: AppServerTreeEntry[];
12
12
  truncated: boolean;
13
13
  }>;
14
+ /**
15
+ * A project file's text, capped at 512 KB. A whole text file also carries `hash`, the SHA-256 of its bytes, which
16
+ * `workspace.write` checks before it saves; `notUtf8` marks one whose bytes are not UTF-8, so saving the decoded text
17
+ * would change them.
18
+ */
14
19
  export declare function readWorkspaceFile(root: string, name: unknown): Promise<{
15
20
  content: string;
16
21
  truncated: boolean;
17
22
  binary: boolean;
18
23
  size: number;
24
+ hash?: string;
25
+ notUtf8?: true;
26
+ }>;
27
+ /** The largest image the Files tab previews; a larger one keeps the binary note. */
28
+ export declare const MAX_IMAGE_BYTES: number;
29
+ export declare function imageTypeOf(path: string): string | undefined;
30
+ /**
31
+ * A project image's bytes, base64, for the Files tab's preview (`workspace.image`). `tooLarge` past 10 MB, with no
32
+ * bytes. The type comes from the extension only: the desktop draws it in an <img>, which never runs an SVG's script.
33
+ */
34
+ export declare function readWorkspaceImage(root: string, name: unknown): Promise<{
35
+ mimeType: string;
36
+ size: number;
37
+ dataBase64?: string;
38
+ tooLarge?: true;
39
+ }>;
40
+ export declare function globMatches(path: string, glob: string): boolean;
41
+ /**
42
+ * A glob list's problems ripgrep would refuse, said before a search: an unclosed `{`, or so many alternatives or
43
+ * `**` that matching could take seconds.
44
+ */
45
+ export declare function globProblem(glob: string): string | undefined;
46
+ /** The most a save from the Files tab may write. */
47
+ export declare const MAX_WRITE_BYTES: number;
48
+ /** `workspace.write`'s checked parameters: the file, as a project-relative path with `/`, and the bytes to save. */
49
+ export declare function writeTarget(root: string, params: Record<string, unknown>): Promise<{
50
+ relative: string;
51
+ bytes: Buffer;
52
+ expectedHash: string;
19
53
  }>;
20
54
  export declare function gitStatus(root: string, options?: {
21
55
  maxBytes?: number;
@@ -87,3 +121,77 @@ export declare function listExtensions(config: Config, signal?: AbortSignal, dir
87
121
  }[];
88
122
  notices: string[];
89
123
  }>;
124
+ /**
125
+ * Every file in the project for quick open, `/`-separated and relative to `root`, capped at 50,000. `.git` and
126
+ * `.andorracode` are skipped, `node_modules` is not walked into (as the tree), symbolic links are not followed, and
127
+ * files Git ignores are marked.
128
+ */
129
+ export declare function listWorkspaceFiles(root: string): Promise<{
130
+ files: {
131
+ path: string;
132
+ ignored?: true;
133
+ }[];
134
+ truncated: boolean;
135
+ }>;
136
+ export declare const SEARCH_MAX_FILES = 200;
137
+ export declare const SEARCH_MAX_MATCHES = 2000;
138
+ export interface WorkspaceSearchOptions {
139
+ query: string;
140
+ regex?: boolean;
141
+ caseSensitive?: boolean;
142
+ wholeWord?: boolean;
143
+ /** Comma-separated globs a file must match (any), and must not match (none). */
144
+ include?: string;
145
+ exclude?: string;
146
+ }
147
+ export interface WorkspaceSearchMatch {
148
+ line: number;
149
+ text: string;
150
+ ranges: {
151
+ start: number;
152
+ end: number;
153
+ }[];
154
+ }
155
+ export interface WorkspaceSearchResult {
156
+ files: {
157
+ path: string;
158
+ matches: WorkspaceSearchMatch[];
159
+ }[];
160
+ matchCount: number;
161
+ /** Why the results stop short of every match, when they do. */
162
+ incomplete?: string;
163
+ engine: 'ripgrep' | 'built-in';
164
+ }
165
+ /** Comma-separated globs; a comma inside `{…}` or `[…]` belongs to its glob (`*.{ts,tsx}`). */
166
+ export declare function globList(value: unknown): string[];
167
+ export declare function searchOptions(params: Record<string, unknown>): WorkspaceSearchOptions;
168
+ /**
169
+ * Ripgrep's byte offsets (ordered) as string offsets, walking the line once; a plain ASCII line needs no walk. A
170
+ * minified line of a megabyte with thousands of matches stays linear.
171
+ */
172
+ export declare function charRanges(text: string, submatches: readonly {
173
+ start: number;
174
+ end: number;
175
+ }[]): {
176
+ start: number;
177
+ end: number;
178
+ }[];
179
+ /**
180
+ * Searches the project's files for `options.query`, with ripgrep when it is installed (it skips what Git ignores) and
181
+ * a built-in scan otherwise. Results stop at 200 files, 2,000 matches or 10 seconds, and say so (`incomplete`).
182
+ */
183
+ export declare function searchWorkspace(root: string, options: WorkspaceSearchOptions, signal?: AbortSignal, rg?: string | null): Promise<WorkspaceSearchResult>;
184
+ /** A GitHub remote URL (https, ssh or git@) as its web address, or undefined for any other host. */
185
+ export declare function githubWebUrl(remote: string): string | undefined;
186
+ /**
187
+ * What a GitHub link to lines needs: the repository's web address, the commit checked out, whether that commit is on
188
+ * a remote branch (so the link resolves), and where the project sits in the repository. Fields are left out where Git
189
+ * cannot say.
190
+ */
191
+ export declare function gitLinkBase(root: string): Promise<{
192
+ repository: boolean;
193
+ webUrl?: string;
194
+ head?: string;
195
+ pushed?: boolean;
196
+ prefix?: string;
197
+ }>;