@openagt/dashboard 0.39.1 → 0.41.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 (156) hide show
  1. package/dist/built-in.d.ts +5 -0
  2. package/dist/built-in.d.ts.map +1 -1
  3. package/dist/built-in.js +7 -0
  4. package/dist/built-in.js.map +1 -1
  5. package/dist/client.d.ts +1 -1
  6. package/dist/client.d.ts.map +1 -1
  7. package/dist/client.js +1 -1
  8. package/dist/client.js.map +1 -1
  9. package/dist/clone-project.d.ts +11 -0
  10. package/dist/clone-project.d.ts.map +1 -1
  11. package/dist/clone-project.js +38 -12
  12. package/dist/clone-project.js.map +1 -1
  13. package/dist/daemon-runtime.d.ts.map +1 -1
  14. package/dist/daemon-runtime.js +216 -63
  15. package/dist/daemon-runtime.js.map +1 -1
  16. package/dist/daemon.js +2 -2
  17. package/dist/daemon.js.map +1 -1
  18. package/dist/dashboard/activity.d.ts +2 -2
  19. package/dist/dashboard/activity.d.ts.map +1 -1
  20. package/dist/dashboard/activity.js +2 -2
  21. package/dist/dashboard/activity.js.map +1 -1
  22. package/dist/dashboard/elsewhere.d.ts +92 -0
  23. package/dist/dashboard/elsewhere.d.ts.map +1 -0
  24. package/dist/dashboard/elsewhere.js +155 -0
  25. package/dist/dashboard/elsewhere.js.map +1 -0
  26. package/dist/dashboard/interventions.d.ts +6 -0
  27. package/dist/dashboard/interventions.d.ts.map +1 -1
  28. package/dist/dashboard/interventions.js.map +1 -1
  29. package/dist/dashboard/machine-interventions.d.ts +52 -0
  30. package/dist/dashboard/machine-interventions.d.ts.map +1 -0
  31. package/dist/dashboard/machine-interventions.js +117 -0
  32. package/dist/dashboard/machine-interventions.js.map +1 -0
  33. package/dist/dashboard/module-serve.d.ts +6 -0
  34. package/dist/dashboard/module-serve.d.ts.map +1 -1
  35. package/dist/dashboard/module-serve.js +11 -1
  36. package/dist/dashboard/module-serve.js.map +1 -1
  37. package/dist/dashboard/overview.d.ts +20 -5
  38. package/dist/dashboard/overview.d.ts.map +1 -1
  39. package/dist/dashboard/overview.js +28 -8
  40. package/dist/dashboard/overview.js.map +1 -1
  41. package/dist/dashboard/projects.d.ts +11 -2
  42. package/dist/dashboard/projects.d.ts.map +1 -1
  43. package/dist/dashboard/projects.js +3 -2
  44. package/dist/dashboard/projects.js.map +1 -1
  45. package/dist/dashboard/relay-endpoints.d.ts +2 -0
  46. package/dist/dashboard/relay-endpoints.d.ts.map +1 -1
  47. package/dist/dashboard/relay-endpoints.js +4 -2
  48. package/dist/dashboard/relay-endpoints.js.map +1 -1
  49. package/dist/dashboard/remote-run.d.ts +1 -6
  50. package/dist/dashboard/remote-run.d.ts.map +1 -1
  51. package/dist/dashboard/remote-run.js +1 -6
  52. package/dist/dashboard/remote-run.js.map +1 -1
  53. package/dist/dashboard/rpc-serve.d.ts +21 -1
  54. package/dist/dashboard/rpc-serve.d.ts.map +1 -1
  55. package/dist/dashboard/rpc-serve.js +9 -3
  56. package/dist/dashboard/rpc-serve.js.map +1 -1
  57. package/dist/dashboard/server.d.ts +2 -0
  58. package/dist/dashboard/server.d.ts.map +1 -1
  59. package/dist/dashboard/server.js +6 -4
  60. package/dist/dashboard/server.js.map +1 -1
  61. package/dist/dashboard/types.d.ts +3 -1
  62. package/dist/dashboard/types.d.ts.map +1 -1
  63. package/dist/dashboard-bundle/assets/host/module-BcFzlJhp.js +1 -0
  64. package/dist/dashboard-bundle/assets/main-Ca6eaXat.css +2 -0
  65. package/dist/dashboard-bundle/assets/main-rpNhGecV.js +148 -0
  66. package/dist/dashboard-bundle/assets/module-Bhd9t16k.js +14 -0
  67. package/dist/dashboard-bundle/index.html +4 -4
  68. package/dist/dashboard-rpc/context.js +1 -1
  69. package/dist/dashboard-rpc/context.js.map +1 -1
  70. package/dist/dashboard-rpc/index.d.ts +2 -2
  71. package/dist/dashboard-rpc/index.d.ts.map +1 -1
  72. package/dist/dashboard-rpc/index.js +2 -2
  73. package/dist/dashboard-rpc/index.js.map +1 -1
  74. package/dist/dashboard-rpc/logins.d.ts +7 -0
  75. package/dist/dashboard-rpc/logins.d.ts.map +1 -1
  76. package/dist/dashboard-rpc/logins.js +17 -0
  77. package/dist/dashboard-rpc/logins.js.map +1 -1
  78. package/dist/dashboard-rpc/machines.d.ts +21 -4
  79. package/dist/dashboard-rpc/machines.d.ts.map +1 -1
  80. package/dist/dashboard-rpc/machines.js +85 -23
  81. package/dist/dashboard-rpc/machines.js.map +1 -1
  82. package/dist/dashboard-rpc/modules.d.ts.map +1 -1
  83. package/dist/dashboard-rpc/modules.js +19 -3
  84. package/dist/dashboard-rpc/modules.js.map +1 -1
  85. package/dist/dashboard-rpc/projects.d.ts +14 -0
  86. package/dist/dashboard-rpc/projects.d.ts.map +1 -1
  87. package/dist/dashboard-rpc/projects.js +48 -5
  88. package/dist/dashboard-rpc/projects.js.map +1 -1
  89. package/dist/dashboard-rpc/reads.d.ts +9 -3
  90. package/dist/dashboard-rpc/reads.d.ts.map +1 -1
  91. package/dist/dashboard-rpc/reads.js +55 -21
  92. package/dist/dashboard-rpc/reads.js.map +1 -1
  93. package/dist/dashboard-rpc/relay-dispatch.d.ts +12 -0
  94. package/dist/dashboard-rpc/relay-dispatch.d.ts.map +1 -1
  95. package/dist/dashboard-rpc/relay-dispatch.js +42 -7
  96. package/dist/dashboard-rpc/relay-dispatch.js.map +1 -1
  97. package/dist/dashboard-rpc/runs-changed.d.ts.map +1 -1
  98. package/dist/dashboard-rpc/runs-changed.js +14 -6
  99. package/dist/dashboard-rpc/runs-changed.js.map +1 -1
  100. package/dist/dashboard-rpc/test-context.d.ts +3 -1
  101. package/dist/dashboard-rpc/test-context.d.ts.map +1 -1
  102. package/dist/dashboard-rpc/test-context.js +13 -1
  103. package/dist/dashboard-rpc/test-context.js.map +1 -1
  104. package/dist/module-types/dashboard/components/MachineMark.d.ts +33 -0
  105. package/dist/module-types/dashboard/lib/models.d.ts +6 -0
  106. package/dist/module-types/dashboard/lib/route.d.ts +6 -0
  107. package/dist/module-types/dashboard/module/index.d.ts +4 -0
  108. package/dist/module-types/dashboard/rpc/machines.d.ts +35 -0
  109. package/dist/module-types/src/built-in.d.ts +5 -0
  110. package/dist/module-types/src/client.d.ts +1 -1
  111. package/dist/module-types/src/clone-project.d.ts +11 -0
  112. package/dist/module-types/src/dashboard/activity.d.ts +2 -2
  113. package/dist/module-types/src/dashboard/elsewhere.d.ts +91 -0
  114. package/dist/module-types/src/dashboard/interventions.d.ts +6 -0
  115. package/dist/module-types/src/dashboard/machine-interventions.d.ts +51 -0
  116. package/dist/module-types/src/dashboard/module-serve.d.ts +6 -0
  117. package/dist/module-types/src/dashboard/overview.d.ts +20 -5
  118. package/dist/module-types/src/dashboard/projects.d.ts +11 -2
  119. package/dist/module-types/src/dashboard/remote-run.d.ts +1 -6
  120. package/dist/module-types/src/dashboard/rpc-serve.d.ts +21 -1
  121. package/dist/module-types/src/dashboard/types.d.ts +3 -1
  122. package/dist/module-types/src/dashboard-rpc/index.d.ts +2 -2
  123. package/dist/module-types/src/dashboard-rpc/logins.d.ts +7 -0
  124. package/dist/module-types/src/dashboard-rpc/machines.d.ts +21 -4
  125. package/dist/module-types/src/dashboard-rpc/projects.d.ts +14 -0
  126. package/dist/module-types/src/dashboard-rpc/reads.d.ts +9 -3
  127. package/dist/module-types/src/dashboard-rpc/relay-dispatch.d.ts +28 -0
  128. package/dist/module-types/src/project-modules.d.ts +19 -0
  129. package/dist/module-types/src/reached-by-line.d.ts +32 -0
  130. package/dist/module-types/src/registry.d.ts +8 -0
  131. package/dist/module-types/src/repository-address.d.ts +6 -0
  132. package/dist/module-types/src/store/agent-store.d.ts +4 -3
  133. package/dist/project-modules.d.ts +19 -0
  134. package/dist/project-modules.d.ts.map +1 -1
  135. package/dist/project-modules.js +42 -2
  136. package/dist/project-modules.js.map +1 -1
  137. package/dist/reached-by-line.d.ts +32 -0
  138. package/dist/reached-by-line.d.ts.map +1 -1
  139. package/dist/reached-by-line.js +51 -0
  140. package/dist/reached-by-line.js.map +1 -1
  141. package/dist/registry.d.ts +8 -0
  142. package/dist/registry.d.ts.map +1 -1
  143. package/dist/registry.js +13 -2
  144. package/dist/registry.js.map +1 -1
  145. package/dist/repository-address.d.ts +6 -0
  146. package/dist/repository-address.d.ts.map +1 -1
  147. package/dist/repository-address.js +9 -0
  148. package/dist/repository-address.js.map +1 -1
  149. package/dist/store/agent-store.d.ts +4 -3
  150. package/dist/store/agent-store.d.ts.map +1 -1
  151. package/dist/store/agent-store.js.map +1 -1
  152. package/package.json +15 -15
  153. package/dist/dashboard-bundle/assets/host/module-CUc1n2SP.js +0 -1
  154. package/dist/dashboard-bundle/assets/main-Cv9CrCec.css +0 -2
  155. package/dist/dashboard-bundle/assets/main-dejlwmyP.js +0 -149
  156. package/dist/dashboard-bundle/assets/module-DR2oCWs5.js +0 -14
@@ -1,25 +1,60 @@
1
- import { onProjectFiles, onGitStatus, onAgentWorktree, onAgentHandoff, onAgent, onOwnRuns } from './reads.js';
2
- import { readModule } from './modules.js';
3
- import { sendStop, sendChoice, sendMessage, sendOpenPullRequest, sendPush, sendMerge } from './control.js';
1
+ import { onProjectFiles, onGitStatus, onAgentWorktree, onAgentHandoff, onAgent, onOwnRuns, onOwnInterventions, onDocs, onAgentsDoing, onRetainedWorktrees, onGitHostHome, onRepositoryOffer } from './reads.js';
2
+ import { readModule, runModuleCommand } from './modules.js';
3
+ import { commandReads, findProjectModule } from '../project-modules.js';
4
+ import { resolveProjectPath } from './context.js';
5
+ import { sendStop, sendChoice, sendMessage, sendOpenPullRequest, sendPush, sendMerge, sendMergeBranch, sendStart } from './control.js';
4
6
  import { asArrived } from './relay-agent.js';
5
- import { onStartCheck } from './projects.js';
7
+ import { onCloneCheck, onCommands, onOwnProjects, onRecordsReach, onStartCheck } from './projects.js';
8
+ import { onProjectSkills } from './skills.js';
6
9
  import { onCopiedLogins, sendCopiedLogin, sendCopiedUsage, sendForgetCopiedLogin, sendKeepCopiedLogin } from './copied-logins.js';
7
10
  import { patchPreferences } from './preferences.js';
11
+ import { onModels } from './models.js';
8
12
  // Each entry is a read or an act, and this is the one place that says which: a computer that only
9
13
  // lets its server watch answers the reads and refuses the acts (relay-endpoints.ts). An entry goes
10
14
  // in one of the two lists, so nothing is relayed that was not classed. `readModule` is a read for
11
15
  // as long as a module's read changes nothing, which is what a module's read is.
12
- const RELAY_READS = { onProjectFiles, readModule, onGitStatus, onAgentWorktree, onAgentHandoff, onAgent, onOwnRuns, onStartCheck };
13
- const RELAY_ACTS = { sendStop, sendChoice, sendMessage, sendOpenPullRequest, sendPush, sendMerge };
16
+ //
17
+ // Besides a run's own calls, a project's: what the person's other computer lists of a project only
18
+ // this computer has (elsewhere.ts) is read here, and a run of it is started here, by the same
19
+ // guarded start a run sent here gets: on this computer, never sent on. What destroys a run's
20
+ // history or checkout, or changes how the project keeps its records, is still no other computer's to do.
21
+ const RELAY_READS = { onProjectFiles, readModule, onGitStatus, onAgentWorktree, onAgentHandoff, onAgent, onOwnRuns, onStartCheck, onCommands, onDocs, onAgentsDoing, onRetainedWorktrees, onGitHostHome, onRepositoryOffer, onProjectSkills, onRecordsReach };
22
+ const RELAY_ACTS = { sendStop, sendChoice, sendMessage, sendOpenPullRequest, sendPush, sendMerge, sendMergeBranch, sendStart: startHere, runModuleCommand };
14
23
  // Null-prototype, like RPC_HANDLERS (R1): the key is a request-controlled string, so a plain object
15
24
  // would answer `constructor`/`toString`/`valueOf` off Object.prototype and invoke them as handlers.
16
25
  const RELAY_FNS = Object.assign(Object.create(null), RELAY_READS, RELAY_ACTS);
26
+ /** A start that came from another computer runs here: the machine it names is the asker's, never sent on from here. */
27
+ function startHere(projectId, prompt, options) {
28
+ const { machine: _askers, ...here } = options && typeof options === 'object' ? options : {};
29
+ return sendStart(projectId, prompt, here);
30
+ }
17
31
  /** The names a relay caller may invoke. */
18
32
  export const RELAY_RPC_NAMES = Object.keys(RELAY_FNS);
33
+ /**
34
+ * The calls a page makes about another computer's project (elsewhere.ts) that this computer passes
35
+ * on to that computer as they are: every relayed one but a start, which goes where "Run on" says,
36
+ * and a computer's own runs, which only a computer asks for.
37
+ */
38
+ export const ELSEWHERE_FORWARDED = new Set(RELAY_RPC_NAMES.filter(name => name !== 'sendStart' && name !== 'onOwnRuns'));
19
39
  /** Whether a relayed RPC only reads. A name that is not on the whitelist is no read. */
20
40
  export function isRelayRead(fn) {
21
41
  return Object.hasOwn(RELAY_READS, fn);
22
42
  }
43
+ /**
44
+ * Whether one relayed call only reads, here: a read by its name, or a module's command that its
45
+ * package says only reads, as this computer's own copy of the module says it. The caller's word
46
+ * for it counts for nothing: a server holding this computer's key could call any command a read.
47
+ */
48
+ export async function isRelayReadCall(projectId, fn, args) {
49
+ if (isRelayRead(fn))
50
+ return true;
51
+ if (fn !== 'runModuleCommand')
52
+ return false;
53
+ const [, pkg, commandArgs, command] = args;
54
+ const root = typeof pkg === 'string' && Array.isArray(commandArgs) ? await resolveProjectPath(projectId) : undefined;
55
+ const module = root ? await findProjectModule(root, pkg).catch(() => undefined) : undefined;
56
+ return module !== undefined && commandReads(module, commandArgs, typeof command === 'string' ? command : undefined);
57
+ }
23
58
  /**
24
59
  * Dispatch one relayed RPC against `projectId` (this machine's own id for the project). `args[0]`
25
60
  * from the caller is the remote daemon's project id and is meaningless here, so it is replaced
@@ -35,7 +70,7 @@ export async function dispatchRelayRpc(projectId, fn, args) {
35
70
  // not a run (logins-sync.ts brings the server's logins and settings up to its own). They go by the
36
71
  // relay too, so a computer that keeps a line open to its server is asked them as any server is:
37
72
  // a line carries nothing but the relay. Classed the same way, read or act.
38
- const MACHINE_READS = { onCopiedLogins };
73
+ const MACHINE_READS = { onCopiedLogins, onOwnProjects, onOwnInterventions, onCloneCheck, onModels };
39
74
  const MACHINE_ACTS = { sendCopiedLogin, sendForgetCopiedLogin, sendKeepCopiedLogin, sendCopiedUsage, patchPreferences };
40
75
  const MACHINE_FNS = Object.assign(Object.create(null), MACHINE_READS, MACHINE_ACTS);
41
76
  /** The machine-wide names a relay caller may invoke. */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a,GAAG,EAAE,cAAc,EAAE,aAAa,EAAE,kBAAkB,EAAE,YAAY,EAAE,QAAQ,EAAE,CAAA;AACnG,MAAM,YAAY,GAAG,EAAE,eAAe,EAAE,qBAAqB,EAAE,mBAAmB,EAAE,eAAe,EAAE,gBAAgB,EAAE,CAAA;AACvH,MAAM,WAAW,GAAG,MAAM,CAAC,MAAM,CAAC,MAAM,CAAC,MAAM,CAAC,IAAI,CAA4B,EAAE,aAAa,EAAE,YAAY,CAAuC,CAAA;AAEpJ,wDAAwD;AACxD,MAAM,CAAC,MAAM,iBAAiB,GAAsB,MAAM,CAAC,IAAI,CAAC,WAAW,CAAC,CAAA;AAE5E,8FAA8F;AAC9F,MAAM,UAAU,aAAa,CAAC,EAAU;IACtC,OAAO,MAAM,CAAC,MAAM,CAAC,aAAa,EAAE,EAAE,CAAC,CAAA;AACzC,CAAC;AAED,wGAAwG;AACxG,MAAM,CAAC,KAAK,UAAU,kBAAkB,CAAC,EAAU,EAAE,IAAe;IAClE,MAAM,IAAI,GAAG,WAAW,CAAC,EAAE,CAAC,CAAA;IAC5B,IAAI,CAAC,IAAI;QAAE,MAAM,IAAI,KAAK,CAAC,wBAAwB,EAAE,EAAE,CAAC,CAAA;IACxD,OAAO,IAAI,CAAC,GAAG,IAAI,CAAC,CAAA;AACtB,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"runs-changed.d.ts","sourceRoot":"","sources":["../../src/dashboard-rpc/runs-changed.ts"],"names":[],"mappings":"AAOA,mEAAmE;AACnE,MAAM,WAAW,WAAW;IAC1B,IAAI,EAAE,MAAM,CAAA;IACZ,SAAS,EAAE,MAAM,CAAA;CAClB;AAOD,kGAAkG;AAClG,wBAAgB,iBAAiB,CAAC,IAAI,EAAE,CAAC,MAAM,EAAE,WAAW,KAAK,IAAI,GAAG,MAAM,IAAI,CAiDjF"}
1
+ {"version":3,"file":"runs-changed.d.ts","sourceRoot":"","sources":["../../src/dashboard-rpc/runs-changed.ts"],"names":[],"mappings":"AAQA,mEAAmE;AACnE,MAAM,WAAW,WAAW;IAC1B,IAAI,EAAE,MAAM,CAAA;IACZ,SAAS,EAAE,MAAM,CAAA;CAClB;AAOD,kGAAkG;AAClG,wBAAgB,iBAAiB,CAAC,IAAI,EAAE,CAAC,MAAM,EAAE,WAAW,KAAK,IAAI,GAAG,MAAM,IAAI,CAyDjF"}
@@ -19,11 +19,17 @@ export function followRunsChanged(send) {
19
19
  }, TOGETHER_MS));
20
20
  };
21
21
  const follow = async () => {
22
- const projects = await contextProjects()
23
- .list()
24
- .catch(() => undefined);
25
- if (stopped || projects === undefined)
22
+ const [own, elsewhere] = await Promise.all([
23
+ contextProjects()
24
+ .list()
25
+ .catch(() => undefined),
26
+ contextRemote()
27
+ .elsewhere()
28
+ .catch(() => []),
29
+ ]);
30
+ if (stopped || own === undefined)
26
31
  return;
32
+ const projects = [...own, ...elsewhere];
27
33
  const paths = new Map(projects.map(project => [project.id, project.path]));
28
34
  for (const [id, one] of followed) {
29
35
  if (paths.get(id) === one.path)
@@ -34,8 +40,10 @@ export function followRunsChanged(send) {
34
40
  for (const project of projects) {
35
41
  if (followed.has(project.id))
36
42
  continue;
37
- const own = ownRunsWatch.follow(project.path, () => tell(project.id));
38
- const machines = contextRemote().followRuns(project.path, () => tell(project.id));
43
+ // Another computer's project has no runs here: that computer's are all it has.
44
+ const elsewhere = project.machine !== undefined;
45
+ const own = elsewhere ? () => { } : ownRunsWatch.follow(project.path, () => tell(project.id));
46
+ const machines = elsewhere ? contextRemote().followElsewhereRuns(project.id, () => tell(project.id)) : contextRemote().followRuns(project.path, () => tell(project.id));
39
47
  followed.set(project.id, {
40
48
  path: project.path,
41
49
  stop: () => {
@@ -1 +1 @@
1
- {"version":3,"file":"runs-changed.js","sourceRoot":"","sources":["../../src/dashboard-rpc/runs-changed.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,4BAA4B,CAAA;AACzD,OAAO,EAAE,eAAe,EAAE,aAAa,EAAE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,IAAI,CAAC,OAAO,CAAC,EAAE,CAAC,CAAC,CAAA;YACvK,QAAQ,CAAC,GAAG,CAAC,OAAO,CAAC,EAAE,EAAE;gBACvB,IAAI,EAAE,OAAO,CAAC,IAAI;gBAClB,IAAI,EAAE,GAAG,EAAE;oBACT,GAAG,EAAE,CAAA;oBACL,QAAQ,EAAE,CAAA;gBACZ,CAAC;aACF,CAAC,CAAA;QACJ,CAAC;IACH,CAAC,CAAA;IACD,KAAK,MAAM,EAAE,CAAA;IACb,MAAM,KAAK,GAAG,WAAW,CAAC,GAAG,EAAE,CAAC,KAAK,MAAM,EAAE,EAAE,iBAAiB,CAAC,CAAA;IACjE,KAAK,CAAC,KAAK,EAAE,EAAE,CAAA;IACf,OAAO,GAAG,EAAE;QACV,OAAO,GAAG,IAAI,CAAA;QACd,aAAa,CAAC,KAAK,CAAC,CAAA;QACpB,KAAK,MAAM,GAAG,IAAI,QAAQ,CAAC,MAAM,EAAE;YAAE,GAAG,CAAC,IAAI,EAAE,CAAA;QAC/C,QAAQ,CAAC,KAAK,EAAE,CAAA;QAChB,KAAK,MAAM,OAAO,IAAI,IAAI,CAAC,MAAM,EAAE;YAAE,YAAY,CAAC,OAAO,CAAC,CAAA;QAC1D,IAAI,CAAC,KAAK,EAAE,CAAA;IACd,CAAC,CAAA;AACH,CAAC"}
@@ -1,4 +1,4 @@
1
- import type { DashboardContext } from '../dashboard/rpc-serve.js';
1
+ import type { DashboardContext, RemoteAgents } from '../dashboard/rpc-serve.js';
2
2
  import type { DashboardOptions } from '../dashboard/server.js';
3
3
  /**
4
4
  * What the dashboard host wires (D3), as a test would have it: every capability present, the two
@@ -7,6 +7,8 @@ import type { DashboardOptions } from '../dashboard/server.js';
7
7
  * it throws. That makes this the one place a test says what the host would have wired, with only
8
8
  * the parts it cares about overridden.
9
9
  */
10
+ /** No other computer of the person's: what a test that builds its own `remote` spreads in when it is about none. */
11
+ export declare const NO_ELSEWHERE: Pick<RemoteAgents, 'elsewhere' | 'elsewhereRuns' | 'followElsewhereRuns' | 'elsewhereHome' | 'bringHere' | 'forward' | 'machinesQueue'>;
10
12
  export declare function testDashboardContext(over?: Partial<DashboardContext>): DashboardContext;
11
13
  /**
12
14
  * The same wiring as {@link testDashboardContext}, in the shape {@link startDashboard} takes: a
@@ -1 +1 @@
1
- {"version":3,"file":"test-context.d.ts","sourceRoot":"","sources":["../../src/dashboard-rpc/test-context.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,2BAA2B,CAAA;AACjE,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAA;AAE9D;;;;;;GAMG;AACH,wBAAgB,oBAAoB,CAAC,IAAI,GAAE,OAAO,CAAC,gBAAgB,CAAM,GAAG,gBAAgB,CAe3F;AAED;;;GAGG;AACH,wBAAgB,oBAAoB,CAAC,IAAI,GAAE,OAAO,CAAC,gBAAgB,CAAM,GAAG,gBAAgB,CAG3F;AAED;;;;;GAKG;AACH,wBAAgB,kBAAkB,CAAC,IAAI,GAAE,OAAO,CAAC,gBAAgB,CAAM,GAAG,IAAI,CAE7E"}
1
+ {"version":3,"file":"test-context.d.ts","sourceRoot":"","sources":["../../src/dashboard-rpc/test-context.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,gBAAgB,EAAE,YAAY,EAAE,MAAM,2BAA2B,CAAA;AAC/E,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAA;AAE9D;;;;;;GAMG;AACH,oHAAoH;AACpH,eAAO,MAAM,YAAY,EAAE,IAAI,CAAC,YAAY,EAAE,WAAW,GAAG,eAAe,GAAG,qBAAqB,GAAG,eAAe,GAAG,WAAW,GAAG,SAAS,GAAG,eAAe,CAUhK,CAAA;AAED,wBAAgB,oBAAoB,CAAC,IAAI,GAAE,OAAO,CAAC,gBAAgB,CAAM,GAAG,gBAAgB,CAe3F;AAED;;;GAGG;AACH,wBAAgB,oBAAoB,CAAC,IAAI,GAAE,OAAO,CAAC,gBAAgB,CAAM,GAAG,gBAAgB,CAG3F;AAED;;;;;GAKG;AACH,wBAAgB,kBAAkB,CAAC,IAAI,GAAE,OAAO,CAAC,gBAAgB,CAAM,GAAG,IAAI,CAE7E"}
@@ -8,6 +8,18 @@ import { defaultQuotaSource } from '../dashboard/quota.js';
8
8
  * it throws. That makes this the one place a test says what the host would have wired, with only
9
9
  * the parts it cares about overridden.
10
10
  */
11
+ /** No other computer of the person's: what a test that builds its own `remote` spreads in when it is about none. */
12
+ export const NO_ELSEWHERE = {
13
+ elsewhere: async () => [],
14
+ machinesQueue: async () => ({ said: [], unread: [] }),
15
+ elsewhereRuns: async () => [],
16
+ followElsewhereRuns: () => () => { },
17
+ elsewhereHome: async () => undefined,
18
+ bringHere: async () => ({ state: 'missing' }),
19
+ forward: async () => {
20
+ throw new Error('no other computer is wired in this test');
21
+ },
22
+ };
11
23
  export function testDashboardContext(over = {}) {
12
24
  return {
13
25
  startAgent: () => ({ ok: false, error: 'not wired in this test' }),
@@ -15,7 +27,7 @@ export function testDashboardContext(over = {}) {
15
27
  startedIn: () => ({ ok: false, error: 'not wired in this test' }),
16
28
  removeProject: () => ({ ok: false, error: 'not wired in this test' }),
17
29
  eventsSource: () => undefined,
18
- remote: { target: () => undefined, list: () => [], working: () => false, rekey: () => { }, sent: () => true, home: async () => undefined, follow: async () => { }, machineNames: async () => () => undefined, machineRuns: async () => [], followRuns: () => () => { } },
30
+ remote: { target: () => undefined, list: () => [], working: () => false, rekey: () => { }, sent: () => true, home: async () => undefined, follow: async () => { }, machineNames: async () => () => undefined, machineRuns: async () => [], followRuns: () => () => { }, ...NO_ELSEWHERE },
19
31
  preferences: registryPreferencesStore(),
20
32
  quota: defaultQuotaSource(),
21
33
  models: { read: async () => ({ 'claude-code': { models: [] }, codex: { models: [] } }) },
@@ -1 +1 @@
1
- {"version":3,"file":"test-context.js","sourceRoot":"","sources":["../../src/dashboard-rpc/test-context.ts"],"names":[],"mappings":"AAAA,O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Aa,EAAE,GAAG,IAAI,EAAE,GAAG,oBAAoB,EAAE,CAAA;IAC5F,OAAO,EAAE,IAAI,EAAE,CAAC,EAAE,OAAO,EAAE,UAAU,EAAE,YAAY,EAAE,UAAU,EAAE,WAAW,EAAE,SAAS,EAAE,eAAe,EAAE,aAAa,EAAE,GAAG,IAAI,EAAE,GAAG,IAAI,EAAE,CAAA;AAC7I,CAAC;AAED;;;;;GAKG;AACH,MAAM,UAAU,kBAAkB,CAAC,IAAI,GAA8B,EAAE;IACrE,mBAAmB,CAAC,oBAAoB,CAAC,IAAI,CAAC,CAAC,CAAA;AACjD,CAAC"}
@@ -0,0 +1,33 @@
1
+ import type { MachineKind } from '../../src/client.js';
2
+ /** The icon of a machine's kind: a computer, a server at home, or a server. */
3
+ export declare const MACHINE_ICONS: {
4
+ readonly computer: import("react").ForwardRefExoticComponent<Omit<import("lucide-react").LucideProps, "ref"> & import("react").RefAttributes<SVGSVGElement>>;
5
+ readonly home: import("react").ForwardRefExoticComponent<Omit<import("lucide-react").LucideProps, "ref"> & import("react").RefAttributes<SVGSVGElement>>;
6
+ readonly shared: import("react").ForwardRefExoticComponent<Omit<import("lucide-react").LucideProps, "ref"> & import("react").RefAttributes<SVGSVGElement>>;
7
+ readonly server: import("react").ForwardRefExoticComponent<Omit<import("lucide-react").LucideProps, "ref"> & import("react").RefAttributes<SVGSVGElement>>;
8
+ };
9
+ /**
10
+ * A machine's mark wherever machines are listed: the icon of its kind, with a dot on it, green
11
+ * while it answers, muted while it does not or is not asked yet. `labelled`, the dot says so to a
12
+ * screen reader; where the row says it in words, it is left out.
13
+ */
14
+ export declare function MachineMark({ kind, online, labelled, className }: {
15
+ kind: MachineKind;
16
+ online: boolean | undefined;
17
+ labelled?: boolean;
18
+ className?: string | undefined;
19
+ }): import("react").JSX.Element;
20
+ /**
21
+ * Where a row's run runs, when that is another of the person's computers: the icon of its kind (a
22
+ * laptop for a computer whose kind is not known) and its name, as the project picker marks a
23
+ * project of another computer's. The name is the first part of the row to give up width. A row
24
+ * with no room for it (`named` off) draws the icon alone, as the list of runs does, and says the
25
+ * name to a screen reader; the row's own hover says it in words.
26
+ */
27
+ export declare function OnComputer({ computer, named }: {
28
+ computer: {
29
+ name: string;
30
+ kind?: MachineKind | undefined;
31
+ };
32
+ named?: boolean;
33
+ }): import("react").JSX.Element;
@@ -6,6 +6,12 @@ import { type DriverModels, type ModelsView } from '../rpc/models.js';
6
6
  * the names from its first frame rather than the ids for a moment.
7
7
  */
8
8
  export declare function useModels(): ModelsView | undefined;
9
+ /**
10
+ * The models a run started on the machine picked in "Run on" can be given: that machine's own, as
11
+ * it asked its agents, which need not be this computer's. `undefined` while it is asked; this
12
+ * computer's when none is picked, or the machine does not say (an OpenAgent that is not asked this).
13
+ */
14
+ export declare function useModelsOn(machineId: string | undefined): ModelsView | undefined;
9
15
  /**
10
16
  * Every coding agent with the models it listed, by the names it gives them, or a line saying why
11
17
  * there are none: the one list every surface that picks a model offers (the start menu, Settings),
@@ -6,6 +6,11 @@ export interface Route {
6
6
  * `''` for its first one. Absent when it is closed. Carried as `?settings=<entry>`.
7
7
  */
8
8
  settings?: string;
9
+ /**
10
+ * A page inside the Settings entry shown, by what the entry knows it as (a saved machine's id,
11
+ * under Devices): what a link from elsewhere on the page opens. Carried as `&item=<it>`.
12
+ */
13
+ settingsItem?: string;
9
14
  /** The project whose agent or "New agent" page shows, by id; null for an Overview and a module's page. */
10
15
  projectId: string | null;
11
16
  /** The selected agent, or null for the project's "New agent" page. */
@@ -23,6 +28,7 @@ export interface Route {
23
28
  }
24
29
  /** The query parameter that carries {@link Route.settings}. */
25
30
  export declare const SETTINGS_PARAM = "settings";
31
+ export declare const SETTINGS_ITEM_PARAM = "item";
26
32
  /**
27
33
  * Read the route out of a URL's path and query, naming projects by `projects`. A first segment
28
34
  * that names no project is a module's page when it can be one, and else a project nobody
@@ -135,6 +135,8 @@ export interface ModuleSettingsProps {
135
135
  * computer's. A save goes to each of them.
136
136
  */
137
137
  projects: ModuleProject[];
138
+ /** A page inside the entry to open, by what the entry knows it as: a link from elsewhere names it (`openSettings(entry, item)`). */
139
+ item?: string;
138
140
  }
139
141
  /**
140
142
  * An entry a module adds to Settings: the package's own settings, read and written through its
@@ -579,6 +581,8 @@ export { Markdown } from '../components/Markdown.js';
579
581
  export { StartAgentButton } from '../components/StartAgentButton.js';
580
582
  export { LinkActions, type ProjectLinks, type LinkTargets } from '../components/LinkActions.js';
581
583
  export { cn } from '../lib/utils.js';
584
+ export { MachineMark } from '../components/MachineMark.js';
585
+ export { machineKind, machineName, type MachineKind } from '../../src/client.js';
582
586
  export { SettingsSection, SettingsRow, SettingsSelectRow, type SettingsOption } from '../components/SettingsRows.js';
583
587
  export { useSettingsCrumb, type SettingsCrumb } from '../lib/settings-crumb.js';
584
588
  export { QrCode } from '../components/QrCode.js';
@@ -0,0 +1,35 @@
1
+ import type * as impl from '../../src/dashboard-rpc/machines.js';
2
+ export type * from '../../src/dashboard-rpc/machines.js';
3
+ export declare const onMachines: () => Promise<impl.Machine[]>;
4
+ export declare const sendAddMachine: (pasted: string, label?: string | undefined, owner?: string | undefined) => Promise<impl.AddMachineResult>;
5
+ export declare const sendRemoveMachine: (id: string) => Promise<impl.RemoveMachineResult>;
6
+ export declare const onMachinesReachable: () => Promise<Record<string, boolean>>;
7
+ export declare const onMachineVersions: () => Promise<impl.MachineVersions>;
8
+ export declare const sendProjectToMachine: (projectId: string, machineId: string) => Promise<impl.ProjectOnMachine>;
9
+ export declare const onProjectOnMachine: (projectId: string, machineId: string) => Promise<impl.ProjectOnMachine>;
10
+ export declare const sendProjectHere: (projectId: string) => Promise<impl.ProjectOnMachine>;
11
+ export declare const onProjectHere: (projectId: string) => Promise<impl.ProjectOnMachine>;
12
+ export declare const onMachineStartCheck: (projectId: string, machineId: string, driver?: string | undefined) => Promise<import("../../src/project-hooks.js").StartReadiness | null>;
13
+ export declare const onMachineModels: (machineId: string) => Promise<import("./models.js").ModelsView | null>;
14
+ export declare const onComputersThrough: (machineId: string) => Promise<impl.ComputersThrough>;
15
+ export declare const sendAddComputerThrough: (machineId: string, computerId: string) => Promise<impl.AddMachineResult>;
16
+ export declare const onMachinePerson: (machineId: string) => Promise<impl.MachinePerson>;
17
+ export declare const sendRemoveMachineDevice: (machineId: string, deviceId: string) => Promise<impl.MachinePerson>;
18
+ export declare const sendRenameMachine: (id: string, label: string) => Promise<impl.AddMachineResult>;
19
+ export declare const sendLetMachineIn: (machineId: string, link: string) => Promise<{
20
+ ok: true;
21
+ } | {
22
+ ok: false;
23
+ error: string;
24
+ }>;
25
+ export declare const sendMachineCode: (machineId: string) => Promise<{
26
+ ok: true;
27
+ value: impl.MachineCode;
28
+ } | {
29
+ ok: false;
30
+ error: string;
31
+ }>;
32
+ export declare const sendMachineTold: (machineId: string) => Promise<{
33
+ ok: boolean;
34
+ }>;
35
+ export declare const onMachineLogins: (machineId: string) => Promise<impl.MachineLoginsResult>;
@@ -39,6 +39,11 @@ export declare function builtInPackages(): Promise<ProjectPackage[]>;
39
39
  export declare function builtInPackagesOf(root: string): Promise<ProjectPackage[]>;
40
40
  /** The project's own installed packages, less the names OpenAgent brings itself. */
41
41
  export declare function ownPackages(root: string): Promise<ProjectPackage[]>;
42
+ /**
43
+ * Every package OpenAgent brings to projects, the picked ones too, whatever a project holds: the
44
+ * copy a module's page is served from on a computer where no project of its own has the module.
45
+ */
46
+ export declare function broughtToProjects(): Promise<ProjectPackage[]>;
42
47
  /** The packages that are this computer's: see {@link COMPUTER_PACKAGES}. */
43
48
  export declare function computerPackages(): Promise<ProjectPackage[]>;
44
49
  /**
@@ -13,7 +13,7 @@ export { SeenTracker } from './dashboard/keyed-watcher.js';
13
13
  export type { ProjectionRead } from './dashboard/projects.js';
14
14
  export { NOTIFICATION_DEFAULTS, MAX_SPEND_OFFSET, notifies, browserNotifyEnabled, notifyCategoryEnabled, type NotifyCategory } from './preference-defaults.js';
15
15
  export { parseMachineLink } from './machine-link.js';
16
- export { reachedByLine } from './reached-by-line.js';
16
+ export { machineKind, machineName, reachedByLine, reachedThrough, type MachineKind } from './reached-by-line.js';
17
17
  export { isLoopbackHost } from './loopback-host.js';
18
18
  export { bridgeChoiceRequest } from './dashboard/bridge-question.js';
19
19
  export { cloudRunState, cloudRunActive, CLOUD_SESSION_WINDOW_MS, type CloudRunState } from './cloud-run-state.js';
@@ -66,3 +66,14 @@ export interface CloneOptions {
66
66
  * folder a second ask could take for the project.
67
67
  */
68
68
  export declare function cloneProject(typed: string, opts?: CloneOptions): Promise<Cloned>;
69
+ /**
70
+ * Whether this computer's logins read the repository at the address, asked of its host without
71
+ * cloning anything: what a run of a project cloned here first would hit before it starts. The
72
+ * answer is the clone's own words when they cannot.
73
+ */
74
+ export declare function canRead(typed: string, opts?: CloneOptions, subject?: string): Promise<{
75
+ ok: true;
76
+ } | {
77
+ ok: false;
78
+ error: string;
79
+ }>;
@@ -22,8 +22,8 @@ export interface Activity {
22
22
  }
23
23
  /** Injectable seam so {@link buildActivity} is unit-testable off disk. */
24
24
  export interface ActivityDeps {
25
- /** A project's runs, live prepended to the archived history, newest-first. Defaults to disk. */
26
- readAgents?: (cwd: string) => Promise<AgentMeta[]>;
25
+ /** A project's runs, live prepended to the archived history, newest-first: off its folder by default, as its computer says them for another computer's. */
26
+ readAgents?: (project: ProjectSummary) => Promise<AgentMeta[]>;
27
27
  }
28
28
  /**
29
29
  * Build the cross-project activity feed: for each registered project's most recent agents, one
@@ -0,0 +1,91 @@
1
+ import type { ProjectSummary } from './projects.js';
2
+ /**
3
+ * The projects of the person's other computers, as this one lists them beside its own: a
4
+ * laptop's on its server, a server's on the laptop. Each computer says its own projects only
5
+ * ({@link OwnProject}), over the relay of the saved machine it is, and only a computer that is
6
+ * the person's own is asked: a computer of another person's, shared on a server, keeps its
7
+ * projects to its person.
8
+ *
9
+ * A project this computer has too, by its repository's address, is listed once, as this
10
+ * computer's: a run of it goes to any computer that has it, by "Run on". One only another
11
+ * computer has is listed as that computer's, under an id of its own ({@link elsewhereId}): what
12
+ * the page asks of it is asked of that computer, and a run of it starts there unless another
13
+ * computer is picked, which clones it first. What a computer said last is kept, so its projects
14
+ * stay listed while it is off.
15
+ */
16
+ /** What a computer says of one of its own projects to another computer of the person's. */
17
+ export interface OwnProject {
18
+ /** Its id there. */
19
+ id: string;
20
+ name: string;
21
+ /** Its folder there. */
22
+ path: string;
23
+ /** Its repository's address ({@link import('../repository-address.js').repositoryAddress}), when it has one. */
24
+ address?: string;
25
+ /** The same address in the letters its `origin` is written with: what another computer clones it from. */
26
+ spelling?: string;
27
+ /** Whether the agents' records of it go to its repository's remote: a copy cloned from it takes the same answer. */
28
+ share: boolean;
29
+ gitHost: boolean;
30
+ activated: boolean;
31
+ lastActivityAt?: string;
32
+ /** The packages that bring it a module's pages there (Queue, Tickets, Automations): the pages it has here too. */
33
+ modules?: string[];
34
+ }
35
+ /** What a computer answered as its projects, the ones that read as projects: anything else is dropped. */
36
+ export declare function ownProjectsOf(said: unknown): OwnProject[];
37
+ /** The id here of a project of another computer's: its id there, and the mark of the saved machine it is. */
38
+ export declare function elsewhereId(projectId: string, machineId: string): string;
39
+ /** Whether an id is that of another computer's project, not one of this computer's own. */
40
+ export declare function isElsewhereId(id: unknown): id is string;
41
+ /** How a call about the project names it to its computer: its repository's address, or its id there when it has none. */
42
+ export declare function lineNameOf(project: Pick<OwnProject, 'id' | 'address'>): string;
43
+ /** The project's id on its computer, from how a call named it there: undefined for an address. */
44
+ export declare function idInLineName(name: string): string | undefined;
45
+ /** A saved machine of the person's own, with what it said of its projects last. */
46
+ export interface OwnMachine {
47
+ id: string;
48
+ projects?: OwnProject[];
49
+ }
50
+ /** A project of another computer's: the saved machine it is on, and the project as that computer said it. */
51
+ export interface ElsewhereHome<M extends OwnMachine = OwnMachine> {
52
+ machine: M;
53
+ project: OwnProject;
54
+ }
55
+ /** The listing of another computer's project, as the page lists projects: marked with the saved machine it is on. */
56
+ export declare function elsewhereSummary(home: ElsewhereHome): ProjectSummary;
57
+ /**
58
+ * The projects of the person's other computers that this one does not have, each listed once:
59
+ * one whose repository's address is a project here is this computer's, and of two computers
60
+ * with the same repository the first one listed has it. A project with no address is only its
61
+ * own computer's, and listed for it.
62
+ */
63
+ export declare function elsewhereHomes<M extends OwnMachine>(machines: readonly M[], ownAddresses: ReadonlySet<string>): ElsewhereHome<M>[];
64
+ /** The project of another computer's with this id, among the saved machines, whether it is listed here or not. */
65
+ export declare function homeOf<M extends OwnMachine>(machines: readonly M[], id: string): ElsewhereHome<M> | undefined;
66
+ /** How long a computer's word on its projects is taken before it is asked again. */
67
+ export declare const PROJECTS_KEPT_MS = 20000;
68
+ /** How long a list waits for a computer never answered before: what it says after comes at the next list. */
69
+ export declare const FIRST_WAIT_MS = 3000;
70
+ /**
71
+ * Each of the person's computers asked for its projects at most every {@link PROJECTS_KEPT_MS}, and
72
+ * what it said kept by `keep` (the saved machine's record), so a list is made of what each said
73
+ * last: at once, while each is asked again behind it. One never answered yet is waited for a
74
+ * little, the first time.
75
+ */
76
+ export declare class OwnProjectsAsked<M extends OwnMachine> {
77
+ /** Ask the machine for its projects. */
78
+ private readonly ask;
79
+ /** Keep what the machine said, when it answered and said otherwise than it had. */
80
+ private readonly keep;
81
+ private readonly now;
82
+ private readonly asked;
83
+ constructor(
84
+ /** Ask the machine for its projects. */
85
+ ask: (machine: M) => Promise<unknown>,
86
+ /** Keep what the machine said, when it answered and said otherwise than it had. */
87
+ keep: (machine: M, projects: OwnProject[]) => Promise<void>, now?: () => number);
88
+ /** Ask each machine whose word is old, and wait for the ones never heard from, a little. */
89
+ refresh(machines: readonly M[]): Promise<void>;
90
+ private askOne;
91
+ }
@@ -4,6 +4,7 @@ import type { ProjectSummary, ProjectionRead } from './projects.js';
4
4
  import { type BranchesFor } from '../store/branches.js';
5
5
  import { type PrLister } from './pull-requests.js';
6
6
  import { type BridgeQuestion } from './bridge-question.js';
7
+ import type { MachineKind } from '../reached-by-line.js';
7
8
  export { interventionKey } from './keys.js';
8
9
  /**
9
10
  * One item awaiting the human: an open `pr` to review and merge or close, a run `awaiting` the
@@ -42,6 +43,11 @@ export interface Intervention {
42
43
  files?: number;
43
44
  /** When the PR was opened (`pr`) or the agent last updated (the other two), ISO, for ordering. */
44
45
  createdAt?: string;
46
+ /** The computer the run it is about runs on, when that is one of the person's other computers: the saved machine's name and kind. */
47
+ computer?: {
48
+ name: string;
49
+ kind: MachineKind;
50
+ };
45
51
  }
46
52
  /** Injectable seam so {@link buildInterventions} is unit-testable off disk. */
47
53
  export interface InterventionsDeps {
@@ -0,0 +1,51 @@
1
+ import type { Intervention } from './interventions.js';
2
+ import type { ProjectionRead } from './projects.js';
3
+ /**
4
+ * The Human Queue of the person's other computers, beside this one's own: what needs the person in
5
+ * a run there (its question, the work it left unpublished, the PR it opened) and the PRs of a
6
+ * project only another computer has. Each computer says the items of its own projects only, never
7
+ * the ones it lists of other computers', so two computers never ask each other in a circle. Here
8
+ * each item is named by the project as it is listed here: this computer's own of the same
9
+ * repository, else the other computer's under its id here; and an item of a run there is marked
10
+ * with that computer.
11
+ */
12
+ /** What the person's other computers said of their Human Queues, each as named here, and the projects here that one which did not answer has. */
13
+ export interface MachinesQueue {
14
+ said: ProjectionRead<Intervention>[];
15
+ /** Projects here whose items on a computer that did not answer are not known: none of them is read whole. */
16
+ unread: string[];
17
+ }
18
+ /** What a computer answered as its Human Queue, the items that read as items, each in the fields an item has: anything else is dropped. */
19
+ export declare function interventionsOf(said: unknown): ProjectionRead<Intervention>;
20
+ /**
21
+ * A computer's Human Queue as named here: each item by `idHere` of its project's id there, and one
22
+ * about a run marked with the computer it runs on. An item of a project not listed here is dropped.
23
+ */
24
+ export declare function namedHere(said: ProjectionRead<Intervention>, idHere: (theirs: string) => string | undefined, computer: NonNullable<Intervention['computer']>): ProjectionRead<Intervention>;
25
+ /**
26
+ * This computer's Human Queue with what the other computers said: each item named as its project is
27
+ * here (`names`, by id: one not listed is dropped), once, newest first. Of a PR both list, the one
28
+ * a run opened is kept: its row opens the run. A project is read whole when every computer that has
29
+ * it answered.
30
+ */
31
+ export declare function withMachinesQueue(own: ProjectionRead<Intervention>, machines: MachinesQueue, names: ReadonlyMap<string, string>): ProjectionRead<Intervention>;
32
+ /** How long a computer's Human Queue is taken before it is asked again: a page asks every few seconds. */
33
+ export declare const QUEUE_KEPT_MS = 10000;
34
+ /** How long a Human Queue waits for a computer never answered before: what it says after comes at the next read. */
35
+ export declare const QUEUE_FIRST_WAIT_MS = 3000;
36
+ /**
37
+ * Each machine asked at most every {@link QUEUE_KEPT_MS}, and what it said last kept: a read is
38
+ * answered at once with that while the machine is asked again behind it. One never answered yet is
39
+ * waited for a little; one whose last ask failed has nothing kept, so its items are not taken as
40
+ * still there.
41
+ */
42
+ export declare class AnswersKept<M extends {
43
+ id: string;
44
+ }, T> {
45
+ private readonly ask;
46
+ private readonly now;
47
+ private readonly kept;
48
+ constructor(ask: (machine: M) => Promise<T>, now?: () => number);
49
+ /** What each machine said last, by its id: one that never answered, or whose last ask failed, has none. */
50
+ of(machines: readonly M[]): Promise<Map<string, T>>;
51
+ }
@@ -5,10 +5,14 @@ import { type ProjectModule } from '../project-modules.js';
5
5
  export declare const MODULES_PREFIX = "/_modules";
6
6
  /** Where the files of the computer's modules are served, which are no project's: `/_computer-modules/<package>/<file>`. */
7
7
  export declare const COMPUTER_MODULES_PREFIX = "/_computer-modules";
8
+ /** Where the files of the modules OpenAgent brings to projects are served from its own copy: `/_brought-modules/<package>/<file>`. */
9
+ export declare const BROUGHT_MODULES_PREFIX = "/_brought-modules";
8
10
  /** The URL a module's browser part is served at from one project. */
9
11
  export declare function moduleUrl(projectId: string, module: Pick<ProjectModule, 'package' | 'entry'>): string;
10
12
  /** The URL the browser part of one of the computer's modules is served at. */
11
13
  export declare function computerModuleUrl(module: Pick<ProjectModule, 'package' | 'entry'>): string;
14
+ /** The URL the browser part of a module OpenAgent brings to projects is served at from its own copy. */
15
+ export declare function broughtModuleUrl(module: Pick<ProjectModule, 'package' | 'entry'>): string;
12
16
  /**
13
17
  * A module's URL with its entry file's version (`?v=`): a browser keeps that file for good, and
14
18
  * the next version of the module is another URL. Without the file there to read, the URL as it is.
@@ -27,3 +31,5 @@ export declare function versionedModuleUrl(url: string, module: Pick<ProjectModu
27
31
  export declare function serveModuleFile(req: IncomingMessage, res: ServerResponse, pathname: string, projects?: ProjectsProvider): Promise<void>;
28
32
  /** Serve one file of a module that is the computer's: as {@link serveModuleFile}, with no project to be registered. */
29
33
  export declare function serveComputerModuleFile(req: IncomingMessage, res: ServerResponse, pathname: string): Promise<void>;
34
+ /** Serve one file of a module OpenAgent brings to projects, from its own copy: as {@link serveComputerModuleFile}. */
35
+ export declare function serveBroughtModuleFile(req: IncomingMessage, res: ServerResponse, pathname: string): Promise<void>;