@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,6 +1,7 @@
1
1
  import { type LiveAgent, type AgentMeta, type AgentStatus } from '../store/index.js';
2
2
  import type { ProjectSummary } from './projects.js';
3
3
  import { type ProjectQueue } from './queue.js';
4
+ import type { MachineKind } from '../reached-by-line.js';
4
5
  /** One project's in-flight run, surfaced in the Overview's "working now" list. */
5
6
  export interface ActiveAgent {
6
7
  projectId: string;
@@ -21,8 +22,14 @@ export interface ActiveAgent {
21
22
  * cloud side is the agent, and "no agents working" over a waiting cloud session was a lie.
22
23
  */
23
24
  cloud?: 'in-cloud' | 'waiting';
24
- /** The machine whose daemon started it (#1648), only when that is not this one. */
25
- host?: string;
25
+ /**
26
+ * The computer it runs on, only when that is not this one: the saved machine's name and kind for
27
+ * a run of one of the person's other computers, else the computer its record names (#1648).
28
+ */
29
+ computer?: {
30
+ name: string;
31
+ kind?: MachineKind;
32
+ };
26
33
  }
27
34
  /** One recently active project, most-recent first. */
28
35
  export interface RecentProject {
@@ -47,7 +54,8 @@ export interface RecentAgent {
47
54
  }
48
55
  /** Injectable reader so {@link buildRecentAgents} is unit-testable off disk. */
49
56
  export interface RecentAgentsDeps {
50
- agents?: (cwd: string) => Promise<AgentMeta[]>;
57
+ /** A project's runs: off its folder for one of this computer's, as its computer says them for another's. */
58
+ agents?: (project: ProjectSummary) => Promise<AgentMeta[]>;
51
59
  }
52
60
  /**
53
61
  * Every project's sessions pooled and sorted newest-first (capped), so the shared sidebar (#shared-
@@ -65,13 +73,20 @@ export interface OverviewDeps {
65
73
  /** Whether the bridge holds a question for that cloud session (default: the daemon's bridge store). */
66
74
  waiting?: (sessionId: string) => boolean;
67
75
  now?: () => number;
76
+ /**
77
+ * The runs the person's other computers say they run of a project, each marked with the saved
78
+ * machine it is (`remoteLabel`): of a project this computer has too, and of one only they have.
79
+ */
80
+ machineRuns?: (project: ProjectSummary) => Promise<AgentMeta[]>;
68
81
  /** This machine's hostname; `node:os` in production. */
69
82
  host?: string;
70
83
  }
71
84
  /**
72
85
  * Build the cross-project Overview: the running agents (every live agent of each project, one per
73
- * worktree since #736), the total of open queue entries (from {@link collectQueue}), and the most
74
- * recently active projects (by {@link ProjectSummary.lastActivityAt}). Forgiving — a project
86
+ * worktree since #736, and every run the person's other computers say is running), the total of
87
+ * open queue entries (from {@link collectQueue}), and the most recently active projects (by
88
+ * {@link ProjectSummary.lastActivityAt}). A project of another computer's ({@link ProjectSummary.machine})
89
+ * has no folder here: only what its computer says of its runs is read. Forgiving — a project
75
90
  * with no live run, or none running, simply contributes nothing to `active`.
76
91
  */
77
92
  export declare function buildOverview(projects: ProjectSummary[], deps?: OverviewDeps): Promise<Overview>;
@@ -12,8 +12,15 @@ import { type GitHostFor } from '../store/git-host.js';
12
12
  export interface ProjectSummary {
13
13
  /** Registry id (stable, URL-safe). */
14
14
  id: string;
15
- /** Absolute repo path. */
15
+ /** Absolute repo path: on the computer the project is on. */
16
16
  path: string;
17
+ /**
18
+ * The saved machine the project is on, when it is not on this computer (elsewhere.ts): what the
19
+ * page asks of it is asked there, and a run of it starts there unless another computer is picked.
20
+ */
21
+ machine?: string;
22
+ /** The packages that bring a module's pages to a project of another computer's, as that computer said them. */
23
+ modules?: string[];
17
24
  /** Display name (the path's basename). */
18
25
  name: string;
19
26
  /** True when the repo still has its `.openagent/` marker. */
@@ -56,10 +63,12 @@ export interface SummarizeDeps {
56
63
  readAgents?: (path: string) => Promise<AgentMeta[]>;
57
64
  /** The project's git host. Defaults to {@link projectGitHost}. */
58
65
  gitHost?: GitHostFor;
66
+ /** The project's name. Defaults to {@link projectNameOf}: its repository's. */
67
+ name?: (path: string) => Promise<string>;
59
68
  }
60
69
  /** A project's runs, live prepended to the archived history. Forgiving: a failed read is `[]`. */
61
70
  /**
62
- * Derive a {@link ProjectSummary} from a registry record: its display name, whether
71
+ * Derive a {@link ProjectSummary} from a registry record: its name (its repository's), whether
63
72
  * it is still activated, and its last activity. Forgiving: a failed read reads as an
64
73
  * inactive project with no activity, never a throw.
65
74
  *
@@ -92,12 +92,7 @@ export declare function deviceIdOf(key: string): string | undefined;
92
92
  export declare function leaveRemote(machine: MachineAccess & {
93
93
  door: string;
94
94
  }): Promise<boolean>;
95
- /**
96
- * Where a server's door passes a call down the line of a computer that keeps one open there: a
97
- * computer at home that nothing on a network reaches is asked at this address, through the
98
- * server, with this computer's key at the server. To this computer it is one more machine.
99
- */
100
- export declare const THROUGH_PATH = "/_devices/via/";
95
+ export { THROUGH_PATH } from '../reached-by-line.js';
101
96
  /** A computer that keeps a line open to a server, as the server's door lists it. */
102
97
  export interface ComputerOnServer {
103
98
  id: string;
@@ -1,4 +1,7 @@
1
1
  import type { IncomingMessage, ServerResponse } from 'node:http';
2
+ import { type OwnProject } from './elsewhere.js';
3
+ import type { MachinesQueue } from './machine-interventions.js';
4
+ import type { ProjectSummary } from './projects.js';
2
5
  import type { OpenAgentEvent } from '../events.js';
3
6
  import type { PreferencesStore } from '../registry.js';
4
7
  import type { QuotaSource } from './quota.js';
@@ -7,7 +10,7 @@ import type { BridgeBrowserOwner } from '../bridge-browser.js';
7
10
  import type { ProjectErrorsReader } from '../project-errors.js';
8
11
  import type { AddProjectResult, RemoveProjectResult, StartAgentOptions, StartAgentResult, StartedInResult } from './types.js';
9
12
  import type { AgentMeta } from '../store/index.js';
10
- import type { RemoteTarget } from './remote-run.js';
13
+ import type { BringProject, RelayProject, RemoteTarget } from './remote-run.js';
11
14
  import type { MachineRuns } from './machine-runs.js';
12
15
  /** Wired by the daemon so `sendStart` can reach the daemon's own `startAgent` closure. */
13
16
  export type StartAgentHandler = (prompt: string, options: StartAgentOptions, projectId?: string) => StartAgentResult | Promise<StartAgentResult>;
@@ -58,6 +61,23 @@ export interface RemoteAgents {
58
61
  machineRuns(projectPath: string): Promise<MachineRuns[]>;
59
62
  /** Tell `changed` each time a saved machine's runs of the project at `projectPath` change, until the answer is called. */
60
63
  followRuns(projectPath: string, changed: () => void): () => void;
64
+ /** The projects of the person's other computers that this one does not have, each marked with the saved machine it is on (elsewhere.ts). */
65
+ elsewhere(): Promise<ProjectSummary[]>;
66
+ /** What the computer another computer's project is on says of its own runs of it, followed for a while from now on. */
67
+ elsewhereRuns(projectId: string): Promise<MachineRuns[]>;
68
+ /** Tell `changed` each time the runs of another computer's project change there, until the answer is called. */
69
+ followElsewhereRuns(projectId: string, changed: () => void): () => void;
70
+ /** Another computer's project by its id here: the saved machine it is on, and the project as that computer said it. */
71
+ elsewhereHome(projectId: string): Promise<{
72
+ machine: string;
73
+ project: OwnProject;
74
+ } | undefined>;
75
+ /** Make a page's call about another computer's project on that computer, and answer what it answered. */
76
+ forward(projectId: string, fn: string, args: unknown[]): Promise<unknown>;
77
+ /** What the person's other computers say of their Human Queues, each named as its project is here (machine-interventions.ts). */
78
+ machinesQueue(): Promise<MachinesQueue>;
79
+ /** Where this computer's copy of the project at `address` stands; with `bring`, cloned and added when there is none, on its own. */
80
+ bringHere(address: string, bring?: BringProject): Promise<RelayProject>;
61
81
  }
62
82
  /**
63
83
  * What every RPC acts through.
@@ -119,12 +119,14 @@ export interface StartAgentOptions {
119
119
  * there is none. `driver` is the coding agent the hook said runs it: what another computer that
120
120
  * follows the run shows, since the run's record stays on this one. `notThere` marks the one
121
121
  * refusal a page can do something about: the machine the run was sent to does not have the
122
- * project yet, and can clone it.
122
+ * project yet, and can clone it. `projectId` is the project the run started in, when it is not the
123
+ * one the start named: this computer's own copy of a project another computer of the person's has.
123
124
  */
124
125
  export type StartAgentResult = {
125
126
  ok: true;
126
127
  agentId: string;
127
128
  driver?: string;
129
+ projectId?: string;
128
130
  } | {
129
131
  ok: false;
130
132
  error: string;
@@ -1,7 +1,7 @@
1
1
  export { onAgents, onModuleAgents, onAgent, onAgentsDoing, onDocs, onQueue, onOverview, onRecentAgents, onInterventions, onActivity, onDashboard, onGitHostHome, onRepositoryOffer, onGitStatus, onProjectFiles, onRetainedWorktrees, onAgentWorktree, onAgentHandoff, onBridgeQuestion, onBridgeStatus, onBridgeToken, onBridgeEvents, onBridgeAnswer, onBridgeBrowser } from './reads.js';
2
2
  export { sendStop, sendChoice, sendBridgeAnswer, sendBridgeAnswerCancel, sendBridgeBrowser, sendMessage, sendStart, sendOpenInApp, sendRemoveWorktree, sendDeleteAgent, sendOpenPullRequest, sendPush, sendMergeBranch, sendMerge, sendCreateRepository } from './control.js';
3
3
  export { streamAgentEvents, type LiveFeedEvent, type PartialMessage, type StreamSync } from './events.js';
4
- export { onProjects, sendAddProject, sendStartedAgain, onCloneTarget, sendAddProjectFromAddress, sendRemoveProject, onRecordsReach, sendShareRecords, sendPickProjectDirectory, onOnboarding, onCommands, onStartCheck, type ProjectLauncher } from './projects.js';
4
+ export { onProjects, sendAddProject, sendStartedAgain, onCloneTarget, sendAddProjectFromAddress, sendRemoveProject, onRecordsReach, sendShareRecords, sendPickProjectDirectory, onOnboarding, onCommands, onStartCheck, onCloneCheck, type ProjectLauncher } from './projects.js';
5
5
  export { onPreferences, savePreferences, patchPreferences, onProjectPresets, saveProjectPresets, onEditors, type SavePreferencesResult, type PatchPreferencesResult, } from './preferences.js';
6
6
  export { type EditorInfo } from '../dashboard/open-in-app.js';
7
7
  export { onQuota } from './quota.js';
@@ -11,7 +11,7 @@ export { onModules, runModuleCommand, runComputerCommand, runComputerCommandOn,
11
11
  export { onProjectSkills, sendChangeSkills, sendProjectSkills, type ProjectSkills, type ProjectSkill, type ChangeSkillsResult } from './skills.js';
12
12
  export { onPerson, type Person } from './person.js';
13
13
  export { onGitHostPeople, type HostPerson } from './people.js';
14
- export { onGitHosts, sendUseGitHostAccount, sendGitHostLogin, sendGitHostInstall, onAgentState, sendAgentFix, onProjectAccounts, sendProjectAccounts, type GitHostsView, type GitHostRow, type GitHostAccount, type GitHostProvider, type AgentState, type ProjectAccountsView, type ProjectAgentAccounts } from './logins.js';
14
+ export { onGitHosts, sendUseGitHostAccount, sendForgetGitHostAccount, sendGitHostLogin, sendGitHostInstall, onAgentState, sendAgentFix, onProjectAccounts, sendProjectAccounts, type GitHostsView, type GitHostRow, type GitHostAccount, type GitHostProvider, type AgentState, type ProjectAccountsView, type ProjectAgentAccounts } from './logins.js';
15
15
  export { onServerLogins, sendUseLoginsOn, sendAllowLogins, sendSettleLogin, type ServerLoginsView, type ServerLogins, type LoginThere } from './server-logins.js';
16
16
  export { onCopiedLogins, sendCopiedLogin, sendForgetCopiedLogin, sendKeepCopiedLogin, sendCopiedUsage, type CopiedView } from './copied-logins.js';
17
17
  export { onAgentAccounts, sendAddAgentAccount, sendAgentAccountCode, sendRemoveAgentAccount, sendUseAgentAccountFirst, sendNameOwnAgentAccount, type AccountsAgent, type AccountRow, type AccountWindow, type AccountAdding, type AccountsView, type AccountResult } from './accounts.js';
@@ -49,6 +49,13 @@ export declare const gitHostPackages: {
49
49
  };
50
50
  /** Runs use `login` at `host` from now on; the terminal's own account stays as it is. */
51
51
  export declare function sendUseGitHostAccount(host: string, login: string): Promise<AccountResult>;
52
+ /**
53
+ * Take an account off at `host`, on this computer: its tool forgets it, and its token goes on
54
+ * working wherever else it is. The account runs use is not taken off: another is picked first.
55
+ * The servers that use this computer's logins are asked again at once, so what they said of it
56
+ * goes with it.
57
+ */
58
+ export declare function sendForgetGitHostAccount(host: string, login: string): Promise<AccountResult>;
52
59
  /** Log another account in at `host`, in the browser: the code the person types, and where. */
53
60
  export declare function sendGitHostLogin(host: string): Promise<{
54
61
  ok: true;
@@ -1,6 +1,7 @@
1
1
  import { type Health } from '../health.js';
2
2
  import { type MachineLogins } from '../dashboard/machine-logins.js';
3
3
  import { type StartReadiness } from '../project-hooks.js';
4
+ import type { ModelsView } from '../dashboard/models.js';
4
5
  /** A saved machine as the browser sees it: no key. */
5
6
  export interface Machine {
6
7
  id: string;
@@ -68,7 +69,9 @@ export declare function onComputersThrough(machineId: string): Promise<Computers
68
69
  /**
69
70
  * Save a computer that keeps a line open to a saved server, as a machine of its own: reached
70
71
  * through the server, with this computer's key there. Nothing is entered anywhere: the server
71
- * already lets this computer in, and passes its calls down the computer's line.
72
+ * already lets this computer in, and passes its calls down the computer's line. Saved again,
73
+ * as every install there ends, an update too, it keeps the person's word that it uses this
74
+ * computer's logins.
72
75
  */
73
76
  export declare function sendAddComputerThrough(machineId: string, computerId: string): Promise<AddMachineResult>;
74
77
  /** Write down that the person was told their logins are copied to a saved machine of another person's: the page says it once. */
@@ -209,8 +212,22 @@ export declare function sendProjectToMachine(projectId: string, machineId: strin
209
212
  export declare function onProjectOnMachine(projectId: string, machineId: string): Promise<ProjectOnMachine>;
210
213
  /**
211
214
  * What would stop a run sent to a saved machine, as the machine says from its own copy of the
212
- * project: its coding agent there, installed and logged in. `null` when there is nothing to say:
213
- * a machine that does not answer, does not have the project yet (it clones it at the first run),
214
- * or has no check.
215
+ * project: its coding agent there, installed and logged in. A machine that does not have the
216
+ * project yet clones it at the first run, and says before it whether it could: its coding agent,
217
+ * and whether its logins read the repository. `null` when there is nothing to say: a machine that
218
+ * does not answer, or one with no check.
215
219
  */
216
220
  export declare function onMachineStartCheck(projectId: string, machineId: string, driver?: string): Promise<StartReadiness | null>;
221
+ /**
222
+ * The models each coding agent offers on a saved machine, as it asked its own: a run sent there is
223
+ * given one of these. `null` when it does not answer, or runs an OpenAgent that is not asked this.
224
+ */
225
+ export declare function onMachineModels(machineId: string): Promise<ModelsView | null>;
226
+ /**
227
+ * Have this computer clone a project only another computer of the person's has (elsewhere.ts),
228
+ * for a run here: on its own, as for a machine that is sent a run. {@link onProjectHere} says when
229
+ * it is here. Nothing happens when it is here already, or on its way.
230
+ */
231
+ export declare function sendProjectHere(projectId: string): Promise<ProjectOnMachine>;
232
+ /** Whether this computer has another computer's project by now, or why it will not. */
233
+ export declare function onProjectHere(projectId: string): Promise<ProjectOnMachine>;
@@ -3,8 +3,15 @@ import { type BranchReach } from '@openagt/agent-data';
3
3
  import { type StartReadiness } from '../project-hooks.js';
4
4
  import { type PickDirectoryResult } from '../pick-directory.js';
5
5
  import type { ProjectSummary } from '../dashboard/projects.js';
6
+ import type { OwnProject } from '../dashboard/elsewhere.js';
6
7
  import type { AddProjectResult, OnboardingSuggestion, RemoveProjectResult, StartedInResult } from '../dashboard/types.js';
7
8
  export declare function onProjects(): Promise<ProjectSummary[]>;
9
+ /**
10
+ * This computer's own projects, for another computer of the person's that lists them beside its
11
+ * own (elsewhere.ts): each with the address another computer names it by and clones it from, and
12
+ * whether its agents' records are shared. Never the projects this computer lists of others.
13
+ */
14
+ export declare function onOwnProjects(): Promise<OwnProject[]>;
8
15
  /**
9
16
  * Add a project from the dashboard (#396/#433): install the repo and register it so it joins the
10
17
  * Projects list. Like `sendStart` this needs the daemon (it spawns git + writes the shared
@@ -110,3 +117,10 @@ export declare function onCommands(projectId: string): Promise<ProjectLauncher |
110
117
  * `null` for an unknown project or one without a check hook: nothing to say.
111
118
  */
112
119
  export declare function onStartCheck(projectId: string, driver?: string): Promise<StartReadiness | null>;
120
+ /**
121
+ * What would stop a run of a project this computer clones first, asked before it does: its coding
122
+ * agent, installed and logged in, and whether its logins read the repository at the address. A
123
+ * computer that does not have the project yet has no check hook of it to run. `as` is what the
124
+ * asker calls this computer, so the words read right on its page.
125
+ */
126
+ export declare function onCloneCheck(address: string, driver?: string, as?: string): Promise<StartReadiness>;
@@ -104,10 +104,10 @@ export declare function markCloudWaiting(agent: AgentMeta): AgentMeta;
104
104
  */
105
105
  export declare function markOtherHost(agent: AgentMeta, thisHost?: string): AgentMeta;
106
106
  /**
107
- * What a run's row says of the saved machine it runs on: the name the machine was given, and
108
- * that it is a person's own computer reached by its line, when it is one.
107
+ * What a run's row says of the saved machine it runs on: its own name, and what it is, which its
108
+ * icon draws, as every list of machines says them (reached-by-line.ts).
109
109
  */
110
- export declare function onMachine(machine: SavedMachine): Pick<AgentMeta, 'remoteLabel' | 'remoteByLine'>;
110
+ export declare function onMachine(machine: SavedMachine): Pick<AgentMeta, 'remoteLabel' | 'remoteKind'>;
111
111
  /**
112
112
  * A run whose record names the computer of a saved machine runs on that machine, whoever started
113
113
  * it there, and reads like one this computer sent: by the name the machine was given. The record
@@ -173,6 +173,12 @@ export declare function onRecentAgents(): Promise<RecentAgent[]>;
173
173
  * backlog the moment the git host answers.
174
174
  */
175
175
  export declare function onInterventions(): Promise<ProjectionRead<Intervention>>;
176
+ /**
177
+ * This computer's own Human Queue, for another computer of the person's that shows it beside its
178
+ * own (machine-interventions.ts): the items of this computer's projects only, never of the
179
+ * projects it lists of other computers, so no computer asks back the one that asked it.
180
+ */
181
+ export declare function onOwnInterventions(): Promise<ProjectionRead<Intervention>>;
176
182
  /**
177
183
  * The cross-project "New activity" feed (#627): recent run started/finished transitions, newest
178
184
  * first, with the projects that were read whole beside them (#1625) — see {@link onInterventions}.
@@ -0,0 +1,28 @@
1
+ /** The names a relay caller may invoke. */
2
+ export declare const RELAY_RPC_NAMES: readonly string[];
3
+ /**
4
+ * The calls a page makes about another computer's project (elsewhere.ts) that this computer passes
5
+ * on to that computer as they are: every relayed one but a start, which goes where "Run on" says,
6
+ * and a computer's own runs, which only a computer asks for.
7
+ */
8
+ export declare const ELSEWHERE_FORWARDED: ReadonlySet<string>;
9
+ /** Whether a relayed RPC only reads. A name that is not on the whitelist is no read. */
10
+ export declare function isRelayRead(fn: string): boolean;
11
+ /**
12
+ * Whether one relayed call only reads, here: a read by its name, or a module's command that its
13
+ * package says only reads, as this computer's own copy of the module says it. The caller's word
14
+ * for it counts for nothing: a server holding this computer's key could call any command a read.
15
+ */
16
+ export declare function isRelayReadCall(projectId: string, fn: string, args: readonly unknown[]): Promise<boolean>;
17
+ /**
18
+ * Dispatch one relayed RPC against `projectId` (this machine's own id for the project). `args[0]`
19
+ * from the caller is the remote daemon's project id and is meaningless here, so it is replaced
20
+ * with `projectId`; the rest (path, agentId, ...) carry through unchanged. Throws on an unknown name.
21
+ */
22
+ export declare function dispatchRelayRpc(projectId: string, fn: string, args: unknown[]): Promise<unknown>;
23
+ /** The machine-wide names a relay caller may invoke. */
24
+ export declare const MACHINE_RPC_NAMES: readonly string[];
25
+ /** Whether a machine-wide call only reads. A name that is not on the whitelist is no read. */
26
+ export declare function isMachineRead(fn: string): boolean;
27
+ /** Dispatch one machine-wide call, its arguments as the caller gave them. Throws on an unknown name. */
28
+ export declare function dispatchMachineRpc(fn: string, args: unknown[]): Promise<unknown>;
@@ -20,7 +20,20 @@ export interface ProjectModule {
20
20
  bins: Record<string, string>;
21
21
  /** The module's server part, an absolute path inside the package, when it has one. */
22
22
  server?: string;
23
+ /**
24
+ * The commands that only read, by command name: the first word of the arguments, or `""` for
25
+ * the command with no word (flags only). What a computer that lets its server only watch answers
26
+ * of the module; any other command changes something there, and is refused. The package says
27
+ * them: `"openagent": { "reads": { "<command>": ["list", ""] } }`.
28
+ */
29
+ reads: Record<string, string[]>;
23
30
  }
31
+ /**
32
+ * Whether running the module's command with these arguments only reads, as its package says
33
+ * ({@link ProjectModule.reads}): its first word is a read, or it has no word and its bare form is
34
+ * one, every argument then being a flag.
35
+ */
36
+ export declare function commandReads(module: Pick<ProjectModule, 'bins' | 'reads'>, args: readonly unknown[], command?: string): boolean;
24
37
  /**
25
38
  * The modules a project has: each of its dependencies whose package.json exports `./dashboard` to
26
39
  * a file that exists inside the package, plus the modules among the packages OpenAgent brings to
@@ -37,6 +50,12 @@ export declare function findProjectModule(root: string, name: string): Promise<P
37
50
  export declare function readComputerModules(): Promise<ProjectModule[]>;
38
51
  /** The one module of this computer's that `name` names, or undefined. */
39
52
  export declare function findComputerModule(name: string): Promise<ProjectModule | undefined>;
53
+ /**
54
+ * The module of a package OpenAgent brings to projects, from OpenAgent's own copy: the page of
55
+ * another computer's project, on a computer where no project of its own has it. Undefined for any
56
+ * other package.
57
+ */
58
+ export declare function findBroughtModule(name: string): Promise<ProjectModule | undefined>;
40
59
  /**
41
60
  * The file a module serves at `rel`, a path relative to its module's directory: its module, its
42
61
  * stylesheet, a chunk. `undefined` for a path that leaves that directory (symlinks resolved) or
@@ -10,3 +10,35 @@
10
10
  * as a computer, not as a server, and has it removed under Devices, where the computer is taken out.
11
11
  */
12
12
  export declare function reachedByLine(url: string): boolean;
13
+ /**
14
+ * Where a server's door passes a call down the line of a computer that keeps one open there: a
15
+ * computer at home that nothing on a network reaches is asked at this address, through the
16
+ * server, with this computer's key at the server. To this computer it is one more machine.
17
+ */
18
+ export declare const THROUGH_PATH = "/_devices/via/";
19
+ /** The server a saved machine is reached through, by its host (`165.245.244.10`); nothing for a machine reached by an address of its own. */
20
+ export declare function reachedThrough(url: string): string | undefined;
21
+ /**
22
+ * A saved machine's own name, as a person says it: the name it was saved with, without the
23
+ * "(through <server>)" a computer reached through a server is saved with, which its row says
24
+ * apart.
25
+ */
26
+ export declare function machineName(machine: {
27
+ label: string;
28
+ url: string;
29
+ }): string;
30
+ /** What a saved machine is: a computer, a server at home reached through a server, another person's computer shared on a server, or a server. */
31
+ export type MachineKind = 'computer' | 'home' | 'shared' | 'server';
32
+ /**
33
+ * What a saved machine is, and in a few words what and where, as every page says it: never the
34
+ * address that stands for it here. A computer is one reached by its line, or by an address on its
35
+ * network; a server is one that speaks HTTPS; an address that is the machine's own name is said once.
36
+ */
37
+ export declare function machineKind(machine: {
38
+ label: string;
39
+ url: string;
40
+ owner?: string | undefined;
41
+ }): {
42
+ kind: MachineKind;
43
+ place: string;
44
+ };
@@ -1,5 +1,6 @@
1
1
  import { type OverviewLayouts } from './overview-layout.js';
2
2
  import { type PublishPick } from './publish-levels.js';
3
+ import { type OwnProject } from './dashboard/elsewhere.js';
3
4
  /**
4
5
  * The multi-project registry (#390): the list of projects the user has
5
6
  * installed OpenAgent into, kept as a single JSON file `.bashrc`-style —
@@ -58,6 +59,8 @@ export interface MachineRecord {
58
59
  listed?: string[];
59
60
  /** When the machine last answered for its runs, ISO, kept to the minute: what its runs say while it does not answer. */
60
61
  seenAt?: string;
62
+ /** Its own projects, as it said them last (elsewhere.ts): a computer of the person's own lists them while it does not answer. */
63
+ projects?: OwnProject[];
61
64
  }
62
65
  /** A GitHub account's name: letters, digits and single dashes, at most 39. */
63
66
  export declare function isAccount(value: unknown): value is string;
@@ -348,6 +351,11 @@ export declare function noteSeen(machine: {
348
351
  id: string;
349
352
  key: string;
350
353
  }, at: string, fs?: RegistryFs, env?: NodeJS.ProcessEnv): Promise<void>;
354
+ /** Keep what a saved machine said of its own projects: the same machine, by its key, or nothing is written. */
355
+ export declare function noteProjects(machine: {
356
+ id: string;
357
+ key: string;
358
+ }, projects: OwnProject[], fs?: RegistryFs, env?: NodeJS.ProcessEnv): Promise<void>;
351
359
  /** Write down that the person was told their logins are copied to a saved machine of another person's. Answers whether it is saved. */
352
360
  export declare function tellMachine(id: string, fs?: RegistryFs, env?: NodeJS.ProcessEnv): Promise<boolean>;
353
361
  /** Say whether a saved server uses this computer's logins. Answers whether it is saved. */
@@ -26,5 +26,11 @@ export declare function spellingOfRemote(remote: string): string | undefined;
26
26
  * machine only.
27
27
  */
28
28
  export declare function repositoryAddress(cwd: string, git?: GitRunner): Promise<string | undefined>;
29
+ /**
30
+ * A project's name: its repository's, the last part of its address in the letters `origin` writes
31
+ * it with, so the project reads the same on every computer whatever its folder there is called.
32
+ * A project with no address is its folder's.
33
+ */
34
+ export declare function projectNameOf(cwd: string, git?: GitRunner): Promise<string>;
29
35
  /** The same address in the letters the `origin` remote is written with: see {@link spellingOfRemote}. */
30
36
  export declare function repositorySpelling(cwd: string, git?: GitRunner): Promise<string | undefined>;
@@ -1,6 +1,7 @@
1
1
  import type { OpenAgentEvent } from '../events.js';
2
2
  import { type BranchesFor, type Checkout } from './branches.js';
3
3
  import { type AnyDiaryLine, type RunsFor } from './runs.js';
4
+ import type { MachineKind } from '../reached-by-line.js';
4
5
  /**
5
6
  * The read side of a project's runs (#1774). The daemon runs no agent and writes no run: a run's
6
7
  * tool keeps the run's card (`<id>.json`) and diary (`<id>.jsonl`) under the `.openagent/`
@@ -202,10 +203,10 @@ export interface AgentMeta {
202
203
  * feed, show a cloud agent's session link after a reload, and gate the browser pane off (#1053).
203
204
  */
204
205
  target?: 'local' | 'actions' | 'remote' | 'web';
205
- /** The saved machine a remote agent (#1067) executes on, for the session list + notice after a reload. */
206
+ /** The saved machine a remote agent (#1067) executes on, by its own name, for the session list + notice after a reload. */
206
207
  remoteLabel?: string;
207
- /** That saved machine is a person's own computer, reached by the line it keeps open here (reached-by-line.ts): the run is drawn with a computer, not a server. */
208
- remoteByLine?: true;
208
+ /** What that saved machine is (reached-by-line.ts): the run is drawn with its kind's icon. */
209
+ remoteKind?: MachineKind;
209
210
  /**
210
211
  * While the run's status is `unknown`: when its computer last answered this one, ISO, when it
211
212
  * did since this computer knows it. Not stored: annotated on the way to the dashboard.
@@ -20,7 +20,20 @@ export interface ProjectModule {
20
20
  bins: Record<string, string>;
21
21
  /** The module's server part, an absolute path inside the package, when it has one. */
22
22
  server?: string;
23
+ /**
24
+ * The commands that only read, by command name: the first word of the arguments, or `""` for
25
+ * the command with no word (flags only). What a computer that lets its server only watch answers
26
+ * of the module; any other command changes something there, and is refused. The package says
27
+ * them: `"openagent": { "reads": { "<command>": ["list", ""] } }`.
28
+ */
29
+ reads: Record<string, string[]>;
23
30
  }
31
+ /**
32
+ * Whether running the module's command with these arguments only reads, as its package says
33
+ * ({@link ProjectModule.reads}): its first word is a read, or it has no word and its bare form is
34
+ * one, every argument then being a flag.
35
+ */
36
+ export declare function commandReads(module: Pick<ProjectModule, 'bins' | 'reads'>, args: readonly unknown[], command?: string): boolean;
24
37
  /**
25
38
  * The modules a project has: each of its dependencies whose package.json exports `./dashboard` to
26
39
  * a file that exists inside the package, plus the modules among the packages OpenAgent brings to
@@ -37,6 +50,12 @@ export declare function findProjectModule(root: string, name: string): Promise<P
37
50
  export declare function readComputerModules(): Promise<ProjectModule[]>;
38
51
  /** The one module of this computer's that `name` names, or undefined. */
39
52
  export declare function findComputerModule(name: string): Promise<ProjectModule | undefined>;
53
+ /**
54
+ * The module of a package OpenAgent brings to projects, from OpenAgent's own copy: the page of
55
+ * another computer's project, on a computer where no project of its own has it. Undefined for any
56
+ * other package.
57
+ */
58
+ export declare function findBroughtModule(name: string): Promise<ProjectModule | undefined>;
40
59
  /**
41
60
  * The file a module serves at `rel`, a path relative to its module's directory: its module, its
42
61
  * stylesheet, a chunk. `undefined` for a path that leaves that directory (symlinks resolved) or
@@ -1 +1 @@
1
- {"version":3,"file":"project-modules.d.ts","sourceRoot":"","sources":["../src/project-modules.ts"],"names":[],"mappings":"AAEA,OAAO,EAAkC,KAAK,oBAAoB,EAAuB,MAAM,qBAAqB,CAAA;AAGpH;;;;;;;GAOG;AACH,MAAM,WAAW,aAAa;IAC5B,0BAA0B;IAC1B,OAAO,EAAE,MAAM,CAAA;IACf,6DAA6D;IAC7D,OAAO,CAAC,EAAE,MAAM,CAAA;IAChB,4GAA4G;IAC5G,GAAG,EAAE,MAAM,CAAA;IACX,gEAAgE;IAChE,KAAK,EAAE,MAAM,CAAA;IACb,2IAA2I;IAC3I,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAA;IAC5B,sFAAsF;IACtF,MAAM,CAAC,EAAE,MAAM,CAAA;CAChB;AA4BD;;;;;GAKG;AACH,wBAAsB,kBAAkB,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,aAAa,EAAE,CAAC,CAO/E;AAgBD,sEAAsE;AACtE,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EAA6E;AAC7E,IAAI,CAAC,EAAE,MAAM,CAAC,UAAU;AACxB,gDAAgD;AAChD,KAAK,CAAC,EAAE,MAAM,GACb,OAAO,CAAC,mBAAmB,CAAC,CAS9B"}
@@ -1,7 +1,36 @@
1
1
  import { realpath, stat } from 'node:fs/promises';
2
2
  import { dirname, join, normalize, sep } from 'node:path';
3
3
  import { packageBins, runPackageCommand } from '@openagt/agent-data';
4
- import { builtInPackagesOf, computerPackages, ownPackages } from './built-in.js';
4
+ import { broughtToProjects, builtInPackagesOf, computerPackages, ownPackages } from './built-in.js';
5
+ /** The commands a package says only read, of the ones it has: anything else in its word is dropped. */
6
+ function readsOf(openagent, bins) {
7
+ const said = openagent && typeof openagent === 'object' ? openagent['reads'] : undefined;
8
+ if (!said || typeof said !== 'object' || Array.isArray(said))
9
+ return {};
10
+ const reads = {};
11
+ for (const [name, words] of Object.entries(said)) {
12
+ if (!Object.hasOwn(bins, name) || !Array.isArray(words))
13
+ continue;
14
+ reads[name] = words.filter((word) => typeof word === 'string' && !word.startsWith('-'));
15
+ }
16
+ return reads;
17
+ }
18
+ /**
19
+ * Whether running the module's command with these arguments only reads, as its package says
20
+ * ({@link ProjectModule.reads}): its first word is a read, or it has no word and its bare form is
21
+ * one, every argument then being a flag.
22
+ */
23
+ export function commandReads(module, args, command) {
24
+ const names = Object.keys(module.bins);
25
+ const name = command ?? (names.length === 1 ? names[0] : undefined);
26
+ const words = name !== undefined && Object.hasOwn(module.reads, name) ? module.reads[name] : [];
27
+ if (!args.every(arg => typeof arg === 'string'))
28
+ return false;
29
+ const first = args[0];
30
+ if (first === undefined || first.startsWith('-'))
31
+ return words.includes('') && args.every(arg => arg.startsWith('-'));
32
+ return words.includes(first);
33
+ }
5
34
  /** The file an `exports[key]` entry names: a plain path, or the first of `conditions` it has. */
6
35
  function exportedFile(exports, key, conditions) {
7
36
  if (!exports || typeof exports !== 'object' || Array.isArray(exports))
@@ -51,13 +80,15 @@ async function readModule({ name, dir: pkgDir, manifest: pkg }) {
51
80
  if (!file)
52
81
  return undefined;
53
82
  const server = await fileInside(pkgDir, exportedFile(pkg.exports, './server', ['node', 'import', 'default']));
83
+ const bins = packageBins(name, pkg.bin, pkgDir);
54
84
  return {
55
85
  package: name,
56
86
  ...(typeof pkg.version === 'string' ? { version: pkg.version } : {}),
57
87
  dir: dirname(file),
58
88
  entry: file.slice(dirname(file).length + 1),
59
- bins: packageBins(name, pkg.bin, pkgDir),
89
+ bins,
60
90
  ...(server ? { server } : {}),
91
+ reads: readsOf(pkg.openagent, bins),
61
92
  };
62
93
  }
63
94
  /** The one module of this project that `name` names, or undefined. */
@@ -81,6 +112,15 @@ export async function readComputerModules() {
81
112
  export async function findComputerModule(name) {
82
113
  return (await readComputerModules()).find(module => module.package === name);
83
114
  }
115
+ /**
116
+ * The module of a package OpenAgent brings to projects, from OpenAgent's own copy: the page of
117
+ * another computer's project, on a computer where no project of its own has it. Undefined for any
118
+ * other package.
119
+ */
120
+ export async function findBroughtModule(name) {
121
+ const pkg = (await broughtToProjects()).find(brought => brought.name === name);
122
+ return pkg ? readModule(pkg) : undefined;
123
+ }
84
124
  /**
85
125
  * The file a module serves at `rel`, a path relative to its module's directory: its module, its
86
126
  * stylesheet, a chunk. `undefined` for a path that leaves that directory (symlinks resolved) or
@@ -1 +1 @@
1
- {"version":3,"file":"project-modules.js","sourceRoot":"","sources":["../src/project-modules.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,IAAI,EAAE,MAAM,kBAAkB,CAAA;AACjD,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,SAAS,EAAE,GAAG,EAAE,MAAM,WAAW,CAAA;AACzD,OAAO,EAAE,WAAW,EAAE,iBAAiB,EAAkD,MAAM,qBAAqB,CAAA;AACpH,OAAO,EAAE,iBAAiB,EAAE,gBAAgB,EAAE,WAAW,EAAE,MAAM,eAAe,CAAA;AAyBhF,iGAAiG;AACjG,SAAS,YAAY,CAAC,OAAgB,EAAE,GAAW,EA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