@andorra-labs/code 0.1.16 → 0.1.17

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 (188) 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 +11 -8
  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/hosted.d.ts +2 -1
  10. package/dist/src/andorra/hosted.js +2 -1
  11. package/dist/src/andorra/notices.d.ts +5 -0
  12. package/dist/src/andorra/notices.js +7 -0
  13. package/dist/src/andorra/state.d.ts +3 -2
  14. package/dist/src/andorra/state.js +4 -4
  15. package/dist/src/andorra/terminal.js +7 -2
  16. package/dist/src/anthropic-credentials.js +2 -0
  17. package/dist/src/app-server/error.d.ts +5 -0
  18. package/dist/src/app-server/error.js +7 -0
  19. package/dist/src/app-server/protocol.d.ts +19 -44
  20. package/dist/src/app-server/protocol.js +5 -1
  21. package/dist/src/app-server/workspace.d.ts +89 -0
  22. package/dist/src/app-server/workspace.js +457 -11
  23. package/dist/src/app-server.d.ts +358 -32
  24. package/dist/src/app-server.js +2429 -509
  25. package/dist/src/bridge/cloud.d.ts +27 -0
  26. package/dist/src/bridge/cloud.js +187 -0
  27. package/dist/src/bridge/command.d.ts +30 -0
  28. package/dist/src/bridge/command.js +347 -0
  29. package/dist/src/bridge/control.d.ts +68 -0
  30. package/dist/src/bridge/control.js +233 -0
  31. package/dist/src/bridge/engines.d.ts +90 -0
  32. package/dist/src/bridge/engines.js +601 -0
  33. package/dist/src/bridge/host-ops.d.ts +9 -0
  34. package/dist/src/bridge/host-ops.js +129 -0
  35. package/dist/src/bridge/host.d.ts +47 -0
  36. package/dist/src/bridge/host.js +540 -0
  37. package/dist/src/bridge/link.d.ts +38 -0
  38. package/dist/src/bridge/link.js +508 -0
  39. package/dist/src/bridge/login-link.d.ts +29 -0
  40. package/dist/src/bridge/login-link.js +54 -0
  41. package/dist/src/bridge/protocol.d.ts +136 -0
  42. package/dist/src/bridge/protocol.js +11 -0
  43. package/dist/src/bridge/store.d.ts +12 -0
  44. package/dist/src/bridge/store.js +61 -0
  45. package/dist/src/bridge/wording.d.ts +6 -0
  46. package/dist/src/bridge/wording.js +10 -0
  47. package/dist/src/browser-server.js +7 -1
  48. package/dist/src/browser-ui/tokens.css +1 -1
  49. package/dist/src/change-authors.d.ts +41 -0
  50. package/dist/src/change-authors.js +146 -0
  51. package/dist/src/cli.js +182 -32
  52. package/dist/src/coding-tools.js +15 -15
  53. package/dist/src/command-screens.d.ts +6 -0
  54. package/dist/src/command-screens.js +14 -11
  55. package/dist/src/commands.d.ts +14 -2
  56. package/dist/src/compaction-phrases.js +1 -1
  57. package/dist/src/completion.js +82 -5
  58. package/dist/src/config.d.ts +71 -3
  59. package/dist/src/config.js +202 -77
  60. package/dist/src/deadline.js +13 -1
  61. package/dist/src/decision/checks.js +1 -1
  62. package/dist/src/decision/requestPhrases.js +0 -1
  63. package/dist/src/default-graph.js +1 -1
  64. package/dist/src/file-diff.d.ts +4 -0
  65. package/dist/src/file-diff.js +2 -1
  66. package/dist/src/github-app/agent-writes.d.ts +102 -0
  67. package/dist/src/github-app/agent-writes.js +320 -0
  68. package/dist/src/github-app/client.d.ts +349 -0
  69. package/dist/src/github-app/client.js +810 -0
  70. package/dist/src/github-app/event-source.d.ts +208 -0
  71. package/dist/src/github-app/event-source.js +684 -0
  72. package/dist/src/github-app/metrics.d.ts +32 -0
  73. package/dist/src/github-app/metrics.js +49 -0
  74. package/dist/src/github-app/review-loop.d.ts +274 -0
  75. package/dist/src/github-app/review-loop.js +1177 -0
  76. package/dist/src/github-app/review-node.d.ts +81 -0
  77. package/dist/src/github-app/review-node.js +205 -0
  78. package/dist/src/github-app/review-post.d.ts +73 -0
  79. package/dist/src/github-app/review-post.js +139 -0
  80. package/dist/src/github-app/review-text.d.ts +107 -0
  81. package/dist/src/github-app/review-text.js +1133 -0
  82. package/dist/src/github-app/review-threads.d.ts +47 -0
  83. package/dist/src/github-app/review-threads.js +107 -0
  84. package/dist/src/github-app/reviewer.d.ts +121 -0
  85. package/dist/src/github-app/reviewer.js +598 -0
  86. package/dist/src/github-app/store.d.ts +59 -0
  87. package/dist/src/github-app/store.js +148 -0
  88. package/dist/src/github-app/triggers.d.ts +141 -0
  89. package/dist/src/github-app/triggers.js +441 -0
  90. package/dist/src/github-names.d.ts +8 -0
  91. package/dist/src/github-names.js +8 -0
  92. package/dist/src/glob-search.d.ts +61 -0
  93. package/dist/src/glob-search.js +180 -0
  94. package/dist/src/graph-health.js +6 -1
  95. package/dist/src/graph-manager-chat.js +1 -1
  96. package/dist/src/graph-preview.d.ts +46 -0
  97. package/dist/src/graph-preview.js +55 -0
  98. package/dist/src/graph-provider-portability.js +2 -1
  99. package/dist/src/graph-runner.js +64 -3
  100. package/dist/src/graph-server.js +3 -3
  101. package/dist/src/graph-sync.js +3 -3
  102. package/dist/src/graph-ui/app.js +91 -7
  103. package/dist/src/graph-ui/icons.js +2 -1
  104. package/dist/src/graph-ui/studio.js +15 -1
  105. package/dist/src/graph-ui/tokens.css +1 -1
  106. package/dist/src/graphs.d.ts +34 -1
  107. package/dist/src/graphs.js +158 -14
  108. package/dist/src/image-input.d.ts +16 -0
  109. package/dist/src/image-input.js +41 -0
  110. package/dist/src/membership.d.ts +10 -0
  111. package/dist/src/membership.js +19 -4
  112. package/dist/src/model-health-cache.js +1 -1
  113. package/dist/src/model-metadata.d.ts +6 -0
  114. package/dist/src/model-metadata.js +35 -15
  115. package/dist/src/model-relay/local.d.ts +116 -0
  116. package/dist/src/model-relay/local.js +468 -0
  117. package/dist/src/model-relay/remote.d.ts +129 -0
  118. package/dist/src/model-relay/remote.js +252 -0
  119. package/dist/src/model-relay/runs.d.ts +34 -0
  120. package/dist/src/model-relay/runs.js +146 -0
  121. package/dist/src/model-relay/wire.d.ts +5 -0
  122. package/dist/src/model-relay/wire.js +5 -0
  123. package/dist/src/project-registry.d.ts +21 -0
  124. package/dist/src/project-registry.js +74 -0
  125. package/dist/src/provider-import.d.ts +0 -12
  126. package/dist/src/provider-import.js +7 -195
  127. package/dist/src/providers.d.ts +23 -2
  128. package/dist/src/providers.js +25 -4
  129. package/dist/src/pull-request-logs.d.ts +12 -1
  130. package/dist/src/pull-request-logs.js +14 -3
  131. package/dist/src/pull-requests.d.ts +327 -7
  132. package/dist/src/pull-requests.js +429 -51
  133. package/dist/src/react-runtime.js +1 -1
  134. package/dist/src/remote/engine-pool.d.ts +88 -4
  135. package/dist/src/remote/engine-pool.js +366 -89
  136. package/dist/src/remote/roots.d.ts +19 -0
  137. package/dist/src/remote/roots.js +45 -7
  138. package/dist/src/remote/types.d.ts +0 -44
  139. package/dist/src/run-control.d.ts +7 -0
  140. package/dist/src/run-control.js +23 -0
  141. package/dist/src/run-records.d.ts +7 -2
  142. package/dist/src/run-records.js +71 -6
  143. package/dist/src/runtime.d.ts +5 -1
  144. package/dist/src/runtime.js +10 -2
  145. package/dist/src/session-changes.d.ts +35 -0
  146. package/dist/src/session-changes.js +194 -6
  147. package/dist/src/session-monitor.js +2 -1
  148. package/dist/src/session-reaper.d.ts +1 -1
  149. package/dist/src/session-reaper.js +6 -1
  150. package/dist/src/session-summary.d.ts +2 -1
  151. package/dist/src/session-summary.js +2 -1
  152. package/dist/src/sessions.d.ts +11 -1
  153. package/dist/src/sessions.js +17 -4
  154. package/dist/src/skills/bundled/diagram/SKILL.md +5 -3
  155. package/dist/src/skills/bundled/graph-manager/SKILL.md +7 -4
  156. package/dist/src/skills/bundled/provenance.json +2 -2
  157. package/dist/src/skills/runtime-skills.js +1 -1
  158. package/dist/src/telemetry/emitter.d.ts +15 -0
  159. package/dist/src/telemetry/emitter.js +35 -1
  160. package/dist/src/telemetry/schema.d.ts +25 -2
  161. package/dist/src/telemetry/schema.js +52 -4
  162. package/dist/src/telemetry/surface.d.ts +2 -1
  163. package/dist/src/telemetry/surface.js +4 -1
  164. package/dist/src/terminal-ui.d.ts +1 -0
  165. package/dist/src/terminal-ui.js +10 -3
  166. package/dist/src/test-edit-guard.d.ts +7 -0
  167. package/dist/src/test-edit-guard.js +49 -1
  168. package/dist/src/timers.d.ts +2 -0
  169. package/dist/src/tools.js +59 -9
  170. package/package.json +6 -1
  171. package/dist/src/remote/cert.d.ts +0 -11
  172. package/dist/src/remote/cert.js +0 -87
  173. package/dist/src/remote/client.d.ts +0 -119
  174. package/dist/src/remote/client.js +0 -544
  175. package/dist/src/remote/command.d.ts +0 -4
  176. package/dist/src/remote/command.js +0 -194
  177. package/dist/src/remote/errors.d.ts +0 -11
  178. package/dist/src/remote/errors.js +0 -14
  179. package/dist/src/remote/network.d.ts +0 -22
  180. package/dist/src/remote/network.js +0 -102
  181. package/dist/src/remote/pairing.d.ts +0 -63
  182. package/dist/src/remote/pairing.js +0 -299
  183. package/dist/src/remote/pem.d.ts +0 -2
  184. package/dist/src/remote/pem.js +0 -7
  185. package/dist/src/remote/serve.d.ts +0 -68
  186. package/dist/src/remote/serve.js +0 -244
  187. package/dist/src/remote/server.d.ts +0 -21
  188. package/dist/src/remote/server.js +0 -406
@@ -1,5 +1,11 @@
1
1
  export declare const REMOTE_PRIMARY_ENGINE = "remote-primary";
2
2
  export declare const RELAY_CAPABILITY_REQUIREMENT = "remote.engine.relay.capability";
3
+ /** How the relay treats a method: whether a desktop may call it on a machine, and whether it changes something there (no deadline slack). */
4
+ export declare function relayMethodClass(method: string): {
5
+ relayed: boolean;
6
+ primary: boolean;
7
+ mutating: boolean;
8
+ };
3
9
  export interface RelayError {
4
10
  code: string;
5
11
  message: string;
@@ -16,6 +22,42 @@ export interface RelayAnswer {
16
22
  result?: unknown;
17
23
  error?: RelayError;
18
24
  }
25
+ export type RelayInstallEvent = {
26
+ version: string;
27
+ state: 'installing';
28
+ } | {
29
+ version: string;
30
+ state: 'ready';
31
+ } | {
32
+ version: string;
33
+ state: 'failed';
34
+ reason: string;
35
+ };
36
+ /** Engines of other versions than this host's: what starts them, and which versions have one running. */
37
+ export interface RelayEngines {
38
+ readonly hostVersion: string;
39
+ /**
40
+ * The command that starts an engine of that version (undefined: the host's own). It never waits on an install: it
41
+ * throws an error whose `code` is `busy` while the version installs, `remote` after an install failed and
42
+ * `invalid-params` for a version this machine cannot run.
43
+ */
44
+ commandFor(version: string | undefined): Promise<string[]>;
45
+ /**
46
+ * Starts installing a missing version when a connection of it opens: `underway` when an install of it had already
47
+ * started, `failed` while a failed install of it cools down.
48
+ */
49
+ prepare?(version: string | undefined): Promise<'started' | 'underway' | 'none' | 'failed'>;
50
+ /** What a connection of that version is to be told at this moment: being installed, the failure it cools down from, or nothing. */
51
+ installState?(version: string): {
52
+ state: 'installing';
53
+ } | {
54
+ state: 'failed';
55
+ reason: string;
56
+ } | undefined;
57
+ watch?(listener: (event: RelayInstallEvent) => void): () => void;
58
+ inUse(version: string): void;
59
+ released(version: string): void;
60
+ }
19
61
  type EventSink = (payload: {
20
62
  engine: string;
21
63
  event: string;
@@ -32,6 +74,7 @@ declare function isRemoteProjectSpelling(value: string): boolean;
32
74
  declare function rootPartOf(value: string): string | undefined;
33
75
  export declare class RemoteEngineRelay {
34
76
  private readonly directory;
77
+ private readonly timing;
35
78
  private readonly children;
36
79
  private readonly retiringChildren;
37
80
  private taskSeq;
@@ -41,24 +84,42 @@ export declare class RemoteEngineRelay {
41
84
  private readonly runEngine;
42
85
  private readonly sessionEngine;
43
86
  private readonly activeRuns;
87
+ private readonly runStates;
44
88
  private readonly finishedRuns;
45
89
  private readonly translations;
46
- private revocationTimer;
90
+ private sinklessTimer;
47
91
  private delivery;
48
92
  private closed;
49
- constructor(directory: string);
93
+ private startsInFlight;
94
+ private readonly engines;
95
+ private readonly stopWatching;
96
+ constructor(directory: string, timing?: {
97
+ sinklessTtlMs?: number;
98
+ sweepMs?: number;
99
+ wakeAnswerMs?: number;
100
+ now?: () => number;
101
+ }, options?: {
102
+ engines?: RelayEngines;
103
+ });
104
+ /** The engine version a connection's tasks run on: undefined for the host's own, and always without a store. */
105
+ private engineVersion;
106
+ private announceInstall;
107
+ private sendInstallEvent;
108
+ private prepareEngine;
50
109
  request(deviceId: string, body: RelayRequestBody): Promise<RelayAnswer>;
51
110
  private validate;
52
111
  private childDeadline;
53
112
  private dispatch;
54
113
  private startRequest;
114
+ private reclaimIdleEngine;
115
+ private taskEngineCount;
55
116
  private runTargetRequest;
56
117
  private terminalRequest;
57
118
  private translateParams;
58
119
  private restoreRequestedEcho;
59
120
  private connection;
60
121
  private sever;
61
- events(deviceId: string, connectionId: string, viewerWorkspaceId: string | undefined, sink: EventSink, cut: () => void): () => void;
122
+ events(deviceId: string, connectionId: string, viewerWorkspaceId: string | undefined, sink: EventSink, cut: () => void, version?: string): () => void;
62
123
  private replayTo;
63
124
  private enqueueTo;
64
125
  private enqueue;
@@ -68,11 +129,34 @@ export declare class RemoteEngineRelay {
68
129
  private engineOwnsRun;
69
130
  private engine;
70
131
  private spawnChild;
132
+ private refuseAtEngineCap;
133
+ private engineCommand;
134
+ private releaseEngine;
71
135
  private childIsIdle;
136
+ private childRunsBackground;
72
137
  private childHoldsWake;
73
138
  private retireChild;
74
139
  private translation;
75
- private startRevocationPoll;
140
+ private startSinklessSweep;
141
+ /** Runs doing work on this machine: a run waiting for the user's computer, an approval or an answer is not counted. */
142
+ activity(): {
143
+ running: number;
144
+ };
145
+ /** Task starts in flight plus runs on task engines, waiting ones included: what a host restart would interrupt. */
146
+ runningTasks(): number;
147
+ /**
148
+ * Work a host restart would lose that runningTasks() may not show: a terminal open on the primary engine, and in any engine
149
+ * a wake armed (it lives only in that engine's memory and starts a run when due), a run as the engine itself reports it
150
+ * (one it started from a wake, the primary's included, which no run.start announced), or a background process still running.
151
+ * An engine that does not answer counts as holding for UNANSWERING_ENGINE_HOLD_MS of silence, and no longer.
152
+ */
153
+ holdsWork(): Promise<boolean>;
154
+ private childHoldsWork;
155
+ /** The engine version the desktop that opened this connection runs, or undefined when it said none or the connection is gone. */
156
+ connectionVersion(connectionId: string): string | undefined;
157
+ disconnect(deviceId: string, connectionId?: string): void;
76
158
  close(): Promise<void>;
77
159
  }
160
+ /** How long an engine that keeps failing to say what wakes it holds is taken to hold one. */
161
+ export declare const UNANSWERING_ENGINE_HOLD_MS = 120000;
78
162
  export { REMOTE_PROJECT_PREFIX, isRemoteProjectSpelling, rootPartOf };