@openagt/dashboard 0.24.0 → 0.26.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 (143) hide show
  1. package/dist/bridge-browser.d.ts +6 -4
  2. package/dist/bridge-browser.d.ts.map +1 -1
  3. package/dist/bridge-browser.js +68 -21
  4. package/dist/bridge-browser.js.map +1 -1
  5. package/dist/browser-stream.d.ts.map +1 -1
  6. package/dist/browser-stream.js +11 -0
  7. package/dist/browser-stream.js.map +1 -1
  8. package/dist/daemon-runtime.d.ts +8 -1
  9. package/dist/daemon-runtime.d.ts.map +1 -1
  10. package/dist/daemon-runtime.js +19 -2
  11. package/dist/daemon-runtime.js.map +1 -1
  12. package/dist/daemon.d.ts +5 -6
  13. package/dist/daemon.d.ts.map +1 -1
  14. package/dist/daemon.js +68 -33
  15. package/dist/daemon.js.map +1 -1
  16. package/dist/dashboard/agent-handoff.d.ts +2 -1
  17. package/dist/dashboard/agent-handoff.d.ts.map +1 -1
  18. package/dist/dashboard/agent-handoff.js +30 -4
  19. package/dist/dashboard/agent-handoff.js.map +1 -1
  20. package/dist/dashboard/cache.js +4 -1
  21. package/dist/dashboard/cache.js.map +1 -1
  22. package/dist/dashboard/index.d.ts +1 -1
  23. package/dist/dashboard/index.d.ts.map +1 -1
  24. package/dist/dashboard/interventions.d.ts +8 -11
  25. package/dist/dashboard/interventions.d.ts.map +1 -1
  26. package/dist/dashboard/interventions.js +106 -133
  27. package/dist/dashboard/interventions.js.map +1 -1
  28. package/dist/dashboard/keys.d.ts +2 -2
  29. package/dist/dashboard/keys.js +4 -4
  30. package/dist/dashboard/keys.js.map +1 -1
  31. package/dist/dashboard/overview.d.ts.map +1 -1
  32. package/dist/dashboard/overview.js +5 -6
  33. package/dist/dashboard/overview.js.map +1 -1
  34. package/dist/dashboard/pull-requests.d.ts +27 -1
  35. package/dist/dashboard/pull-requests.d.ts.map +1 -1
  36. package/dist/dashboard/pull-requests.js +55 -1
  37. package/dist/dashboard/pull-requests.js.map +1 -1
  38. package/dist/dashboard/rpc-serve.d.ts +4 -1
  39. package/dist/dashboard/rpc-serve.d.ts.map +1 -1
  40. package/dist/dashboard/rpc-serve.js.map +1 -1
  41. package/dist/dashboard/server.d.ts +3 -1
  42. package/dist/dashboard/server.d.ts.map +1 -1
  43. package/dist/dashboard/server.js +1 -0
  44. package/dist/dashboard/server.js.map +1 -1
  45. package/dist/dashboard/types.d.ts +18 -0
  46. package/dist/dashboard/types.d.ts.map +1 -1
  47. package/dist/dashboard/unpublished.d.ts +43 -0
  48. package/dist/dashboard/unpublished.d.ts.map +1 -0
  49. package/dist/dashboard/unpublished.js +74 -0
  50. package/dist/dashboard/unpublished.js.map +1 -0
  51. package/dist/dashboard-bundle/assets/main-CTqah6if.js +145 -0
  52. package/dist/dashboard-bundle/assets/main-iqtcpdTX.css +2 -0
  53. package/dist/dashboard-bundle/assets/module-Dy8zK3Qd.js +14 -0
  54. package/dist/dashboard-bundle/host/module.js +1 -1
  55. package/dist/dashboard-bundle/index.html +3 -3
  56. package/dist/dashboard-rpc/context.d.ts +2 -0
  57. package/dist/dashboard-rpc/context.d.ts.map +1 -1
  58. package/dist/dashboard-rpc/context.js +4 -0
  59. package/dist/dashboard-rpc/context.js.map +1 -1
  60. package/dist/dashboard-rpc/control.d.ts.map +1 -1
  61. package/dist/dashboard-rpc/control.js +17 -2
  62. package/dist/dashboard-rpc/control.js.map +1 -1
  63. package/dist/dashboard-rpc/index.d.ts +1 -1
  64. package/dist/dashboard-rpc/index.d.ts.map +1 -1
  65. package/dist/dashboard-rpc/index.js +1 -1
  66. package/dist/dashboard-rpc/index.js.map +1 -1
  67. package/dist/dashboard-rpc/projects.d.ts +11 -1
  68. package/dist/dashboard-rpc/projects.d.ts.map +1 -1
  69. package/dist/dashboard-rpc/projects.js +15 -1
  70. package/dist/dashboard-rpc/projects.js.map +1 -1
  71. package/dist/dashboard-rpc/reads.d.ts +18 -1
  72. package/dist/dashboard-rpc/reads.d.ts.map +1 -1
  73. package/dist/dashboard-rpc/reads.js +40 -2
  74. package/dist/dashboard-rpc/reads.js.map +1 -1
  75. package/dist/dashboard-rpc/relay-agent.d.ts +2 -0
  76. package/dist/dashboard-rpc/relay-agent.d.ts.map +1 -1
  77. package/dist/dashboard-rpc/relay-agent.js +2 -0
  78. package/dist/dashboard-rpc/relay-agent.js.map +1 -1
  79. package/dist/dashboard-rpc/test-context.d.ts.map +1 -1
  80. package/dist/dashboard-rpc/test-context.js +3 -2
  81. package/dist/dashboard-rpc/test-context.js.map +1 -1
  82. package/dist/join-dashboard.d.ts +21 -0
  83. package/dist/join-dashboard.d.ts.map +1 -0
  84. package/dist/join-dashboard.js +22 -0
  85. package/dist/join-dashboard.js.map +1 -0
  86. package/dist/module-types/dashboard/components/ui/card.d.ts +1 -1
  87. package/dist/module-types/dashboard/components/ui/checkbox.d.ts +1 -1
  88. package/dist/module-types/dashboard/components/ui/context-menu.d.ts +2 -2
  89. package/dist/module-types/dashboard/components/ui/dropdown-menu.d.ts +2 -2
  90. package/dist/module-types/dashboard/components/ui/popover.d.ts +1 -1
  91. package/dist/module-types/dashboard/components/ui/radio-group.d.ts +2 -2
  92. package/dist/module-types/dashboard/components/ui/scroll-area.d.ts +1 -1
  93. package/dist/module-types/dashboard/components/ui/select.d.ts +1 -1
  94. package/dist/module-types/dashboard/components/ui/separator.d.ts +1 -1
  95. package/dist/module-types/dashboard/components/ui/switch.d.ts +1 -1
  96. package/dist/module-types/dashboard/components/ui/tooltip.d.ts +3 -3
  97. package/dist/module-types/dashboard/lib/data-link.d.ts +1 -1
  98. package/dist/module-types/dashboard/lib/route.d.ts +11 -24
  99. package/dist/module-types/dashboard/module/index.d.ts +15 -8
  100. package/dist/module-types/src/bridge-browser.d.ts +6 -4
  101. package/dist/module-types/src/dashboard/agent-handoff.d.ts +2 -1
  102. package/dist/module-types/src/dashboard/interventions.d.ts +8 -11
  103. package/dist/module-types/src/dashboard/keys.d.ts +2 -2
  104. package/dist/module-types/src/dashboard/pull-requests.d.ts +27 -1
  105. package/dist/module-types/src/dashboard/rpc-serve.d.ts +4 -1
  106. package/dist/module-types/src/dashboard/types.d.ts +18 -0
  107. package/dist/module-types/src/dashboard/unpublished.d.ts +42 -0
  108. package/dist/module-types/src/dashboard-rpc/context.d.ts +2 -0
  109. package/dist/module-types/src/dashboard-rpc/index.d.ts +1 -1
  110. package/dist/module-types/src/dashboard-rpc/projects.d.ts +11 -1
  111. package/dist/module-types/src/dashboard-rpc/reads.d.ts +18 -1
  112. package/dist/module-types/src/dashboard-rpc/relay-agent.d.ts +2 -0
  113. package/dist/module-types/src/project-address.d.ts +32 -0
  114. package/dist/module-types/src/store/agent-store.d.ts +13 -0
  115. package/dist/module-types/src/store/branches.d.ts +28 -2
  116. package/dist/module-types/src/store/index.d.ts +1 -1
  117. package/dist/module.css +1 -0
  118. package/dist/project-address.d.ts +33 -0
  119. package/dist/project-address.d.ts.map +1 -0
  120. package/dist/project-address.js +57 -0
  121. package/dist/project-address.js.map +1 -0
  122. package/dist/serve.d.ts +2 -0
  123. package/dist/serve.d.ts.map +1 -1
  124. package/dist/serve.js +1 -0
  125. package/dist/serve.js.map +1 -1
  126. package/dist/store/agent-store.d.ts +13 -0
  127. package/dist/store/agent-store.d.ts.map +1 -1
  128. package/dist/store/agent-store.js.map +1 -1
  129. package/dist/store/branches.d.ts +28 -2
  130. package/dist/store/branches.d.ts.map +1 -1
  131. package/dist/store/branches.js +38 -22
  132. package/dist/store/branches.js.map +1 -1
  133. package/dist/store/index.d.ts +1 -1
  134. package/dist/store/index.d.ts.map +1 -1
  135. package/dist/store/index.js +1 -1
  136. package/dist/store/index.js.map +1 -1
  137. package/dist/store/test-branches.d.ts.map +1 -1
  138. package/dist/store/test-branches.js +6 -0
  139. package/dist/store/test-branches.js.map +1 -1
  140. package/package.json +14 -14
  141. package/dist/dashboard-bundle/assets/main-CvaxZfR1.css +0 -2
  142. package/dist/dashboard-bundle/assets/main-DjBIKKEF.js +0 -141
  143. package/dist/dashboard-bundle/assets/module-DpIObawb.js +0 -25
@@ -1,5 +1,5 @@
1
1
  import type { BridgeBrowserStatus } from '../bridge-browser.js';
2
- import { type AgentDoing, type AgentMeta } from '../store/index.js';
2
+ import { type AgentDoing, type AgentMeta, type BranchesFor } from '../store/index.js';
3
3
  import { type GitHostHome } from '../store/git-host.js';
4
4
  import { type RepositoryOffer } from '../store/repository.js';
5
5
  import { type WorkspaceDoc } from '../dashboard/docs.js';
@@ -12,6 +12,7 @@ import { type Activity } from '../dashboard/activity.js';
12
12
  import { type DashboardData } from '../dashboard/dashboard.js';
13
13
  import { type GitStatus } from '../dashboard/git-status.js';
14
14
  import { type AgentHandoff } from '../dashboard/agent-handoff.js';
15
+ import { type PrState } from '../dashboard/pull-requests.js';
15
16
  import type { AgentWorktree } from '../dashboard/types.js';
16
17
  import type { OpenAgentEvent } from '../events.js';
17
18
  import type { BridgeEvent, BridgeHello, BridgeQuestion } from '../dashboard/bridge-endpoints.js';
@@ -37,6 +38,22 @@ import type { SavedMachine } from '../dashboard/rpc-serve.js';
37
38
  * instead of losing it.
38
39
  */
39
40
  export declare function onAgents(projectId: string): Promise<AgentMeta[]>;
41
+ /**
42
+ * What a run's row marks beside its name, for both lists of runs, a project's and all projects'
43
+ * together: how its pull request stands, and the work it left on this machine.
44
+ */
45
+ export declare function withRowMarks(cwd: string, agents: AgentMeta[]): Promise<AgentMeta[]>;
46
+ /**
47
+ * Each run that has a pull request, marked with how the request stands, so its row can show it:
48
+ * from one cached listing of the project's requests, read only when one of the runs has a request.
49
+ */
50
+ export declare function withPrStates(cwd: string, agents: AgentMeta[], states?: (cwd: string) => Promise<Map<string, PrState>>): Promise<AgentMeta[]>;
51
+ /**
52
+ * Each finished run whose work never left this machine, marked with how many files it left
53
+ * uncommitted and how many commits wait, so its row can say so as the Human Queue does: the same
54
+ * rule, {@link unpublishedRuns}. A provider that cannot be read marks nothing.
55
+ */
56
+ export declare function withUnpublished(cwd: string, agents: AgentMeta[], branches?: BranchesFor): Promise<AgentMeta[]>;
40
57
  /**
41
58
  * A project's runs with the ones this daemon follows on a machine (#1067), which live in its
42
59
  * memory. A run this computer sent that has no record here is listed first, as followed, so a
@@ -1,5 +1,7 @@
1
1
  /** Run `call` as one that came in from another computer: nothing in it is passed on to a machine. */
2
2
  export declare function asArrived<T>(call: () => Promise<T>): Promise<T>;
3
+ /** Whether the call being run came in from another computer. */
4
+ export declare const isArrived: () => boolean;
3
5
  /**
4
6
  * Run a run-scoped RPC locally, or relay it to the machine when `agentId` names an agent that runs on a
5
7
  * saved one (#1067 slice 2): one this daemon sent there, or one the machine's own page started,
@@ -0,0 +1,32 @@
1
+ /**
2
+ * The words the dashboard keeps for itself, after a project's address and in its place: `overview`,
3
+ * a project's Overview, and `settings` (#958), where Settings was a page. Settings is a dialog over
4
+ * the page you are on now, carried as `?settings=`; the old address still opens it, over the
5
+ * Overview. No module's page takes either.
6
+ */
7
+ export declare const OVERVIEW_SEGMENT = "overview";
8
+ export declare const SETTINGS_SEGMENT = "settings";
9
+ /**
10
+ * Whether a segment can name a page a module adds (#1774): a lowercase letter, then lowercase
11
+ * letters and digits, and not a word the dashboard keeps. Whichever module claims the segment gets
12
+ * it, and the shell says "no such page" when none does, or when the picked project has no package
13
+ * that adds it.
14
+ */
15
+ export declare function isPageSegment(segment: string): boolean;
16
+ /** Each registered project's address, and the project an address or an id names. */
17
+ export interface ProjectAddresses {
18
+ /** The project's address: its name, or its id where the name cannot be one. An unknown id is its own address. */
19
+ addressOf(projectId: string): string;
20
+ /** The project a first segment names, by its address or by its id; undefined for none. */
21
+ projectOf(segment: string): string | undefined;
22
+ }
23
+ /**
24
+ * The addresses of the registered projects, in the registry's order, beside the pages' words.
25
+ * A project's name is its id without the `-<hash>`: its folder's name, as the id writes it. The
26
+ * name is its address unless a page has that word, since pages win, or a project before it in the
27
+ * registry already has that name: the first one added keeps it, so adding a second clone changes
28
+ * no address in use.
29
+ */
30
+ export declare function projectAddresses(projectIds: readonly string[], pageWords: readonly string[]): ProjectAddresses;
31
+ /** No project registered: every first segment is a page's, or a project's nobody registered. */
32
+ export declare const NO_PROJECTS: ProjectAddresses;
@@ -151,6 +151,19 @@ export interface AgentMeta {
151
151
  * machine can ask whether the process is alive.
152
152
  */
153
153
  saving?: boolean;
154
+ /**
155
+ * How the run's pull request stands ({@link pr}), as the git host last said. Not stored: annotated
156
+ * on the way to the dashboard like {@link saving}, since it changes on the git host, not here.
157
+ */
158
+ prState?: 'open' | 'draft' | 'merged' | 'closed';
159
+ /**
160
+ * How many commits of the run's own wait on its branch, never pushed: its work has not left this
161
+ * machine. Not stored: annotated on the way to the dashboard like {@link prState}, since a push
162
+ * changes it, not the run.
163
+ */
164
+ unpublished?: number;
165
+ /** How many files the run's checkout left uncommitted, annotated like {@link unpublished}. */
166
+ uncommitted?: number;
154
167
  /**
155
168
  * The loopback port the agent's browser preview is listening on (#813), or absent when the agent
156
169
  * has no browser. What lets the daemon proxy the pane: the port is allocated per agent and the
@@ -13,10 +13,12 @@
13
13
  * `<command> show [--from <commit>] <branch>...` what each branch holds and where it stands, as an array of {@link BranchState}, in the order asked;
14
14
  * measured from `<commit>`, where the branches started, in place of the default branch;
15
15
  * a full commit id in place of a branch is read as a branch that ends there
16
+ * `<command> ahead [--from <commit>] <branch>...` how far each branch is past the base, whether the remote has it, and what its checkout left uncommitted,
17
+ * as an array of {@link BranchAhead}: no file lists, so every run's branch can be asked on a poll
16
18
  * `<command> merge <b>` merge the branch into the default branch, on this machine, then delete it
17
19
  * `<command> push --branch <b>` push the branch to the remote; a branch only the remote has is answered as it is
18
20
  * `<command> remove <id> [--from <commit>] [--discard]` reclaim a run's checkout once its branch holds everything, pushing nothing, its branch measured from the commit it started from; `--discard` drops uncommitted work
19
- * `list` and `show` read this machine, no network: OpenAgent polls. `show` answers the branch's
21
+ * `list`, `show` and `ahead` read this machine, no network: OpenAgent polls. `show` answers the branch's
20
22
  * git facts only; its pull request is the git host provider's (`git-host.ts`), as every pull request is.
21
23
  *
22
24
  * That is the whole contract: git, and nothing beyond it (#1820). OpenAgent reads checkouts to
@@ -24,7 +26,7 @@
24
26
  * the Human Queue's unpushed rows. Opening a pull request is the push here, then the git host
25
27
  * provider's `open`. What a checkout is, where it lives, how a branch is pushed is the package's.
26
28
  *
27
- * The shapes, owned here: {@link Checkout}, {@link BranchState}.
29
+ * The shapes, owned here: {@link Checkout}, {@link BranchState}, {@link BranchAhead}.
28
30
  */
29
31
  /** A run's checkout: where it works, as a provider lists it. */
30
32
  export interface Checkout {
@@ -74,6 +76,26 @@ export interface BranchState {
74
76
  /** The uncommitted paths in the checkout that is on this branch; absent when no checkout is. */
75
77
  pendingFiles?: string[];
76
78
  }
79
+ /** How far a branch is past its base and whether the remote has it, as a provider answers `ahead`: counts, no files. */
80
+ export interface BranchAhead {
81
+ branch: string;
82
+ /** The branch exists on this machine. */
83
+ exists: boolean;
84
+ /** A branch the provider made for a run, not one of the person's own. */
85
+ agent: boolean;
86
+ /** How many commits of its own it has beyond the base. */
87
+ ahead: number;
88
+ /** The project has a remote to push to. */
89
+ hasRemote: boolean;
90
+ /** The remote has the branch at this same tip. */
91
+ pushed: boolean;
92
+ /** It was pushed, and the remote's copy is gone since, as a merged pull request's is. */
93
+ gone: boolean;
94
+ /** The project's default branch already contains it. */
95
+ merged: boolean;
96
+ /** How many paths the run's checkout on it left uncommitted; 0 with no checkout. */
97
+ uncommitted: number;
98
+ }
77
99
  /** What pushing a branch did: `pushed` is false when only the remote had it, so there was nothing here to push. */
78
100
  export type PushOutcome = {
79
101
  ok: true;
@@ -124,6 +146,8 @@ export interface BranchesSource {
124
146
  * branch that ended there held.
125
147
  */
126
148
  show(branches: readonly string[], from?: string): Promise<BranchState[]>;
149
+ /** How far each branch is past its base and whether the remote has it, in the order asked; `[]` when nothing can be read. `from` as for {@link show}. */
150
+ ahead(branches: readonly string[], from?: string): Promise<BranchAhead[]>;
127
151
  /** Push a branch to the remote: the checkout on it under its clean rule, else the branch itself. */
128
152
  push(branch: string): Promise<PushOutcome>;
129
153
  /** Merge a branch into the project's default branch, on this machine, then delete it; a merge that conflicts changes nothing. */
@@ -148,6 +172,8 @@ export type BranchesReader = BranchesFor & {
148
172
  export declare function parseCheckouts(output: unknown): Checkout[];
149
173
  /** The states read back from a provider's `show`: the objects with a branch and the three verdicts, lists cleaned; anything else is no state. */
150
174
  export declare function parseBranchStates(output: unknown): BranchState[];
175
+ /** The counts read back from a provider's `ahead`: the objects with a branch and every verdict; anything else is no answer. */
176
+ export declare function parseBranchesAhead(output: unknown): BranchAhead[];
151
177
  /**
152
178
  * The production {@link BranchesReader}: the project's provider, looked up among the packages the project has (`built-in.ts`),
153
179
  * one source per project kept while the same command provides — so the cache holds across the
@@ -1,7 +1,7 @@
1
1
  export { nodeStoreFs, listAgents, readAllAgents, findAgent, isPidAlive, readLiveMeta, loadAgentEvents, readLiveMetas, readDoing, type AgentDoing, readFinishedDiary, type StoreFs, type AgentMeta, type LiveAgent, type AgentStatus, } from './agent-store.js';
2
2
  export { findCheckout, resolveAgentCheckout, resolveAgentDiary, type AgentDiarySource } from './agent-checkout.js';
3
3
  export { projectRuns, providedRuns, noRuns, parseRunCard, isRunId, type RunsFor, type RunsReader, type RunsSource, type RunsWrite, type RunCard, type RunPatch, type RunStatus, type AnyDiaryLine, type FinishedRun } from './runs.js';
4
- export { projectBranches, providedBranches, noBranches, parseCheckouts, parseBranchStates, type BranchesFor, type BranchesReader, type BranchesSource, type RemoveOutcome as BranchRemoveOutcome, type Checkout, type BranchState, type BranchCommit, type BranchFile, type PushOutcome as BranchPushOutcome } from './branches.js';
4
+ export { projectBranches, providedBranches, noBranches, parseCheckouts, parseBranchStates, parseBranchesAhead, type BranchesFor, type BranchesReader, type BranchesSource, type RemoveOutcome as BranchRemoveOutcome, type Checkout, type BranchState, type BranchAhead, type BranchCommit, type BranchFile, type PushOutcome as BranchPushOutcome } from './branches.js';
5
5
  export { projectGitHost, providedGitHost, noGitHost, parseRequests, type GitHostFor, type GitHostReader, type GitHostSource, type GitHostRequest, type GitHostHome, type RequestsOutcome as GitHostRequestsOutcome, type OpenOutcome as GitHostOpenOutcome, type MergeOutcome as GitHostMergeOutcome } from './git-host.js';
6
6
  export { projectQueue, providedQueue, noQueue, parseQueueEntries, type QueueFor, type QueueReader, type QueueSource } from './queue.js';
7
7
  export { providedDataChanged } from './provided.js';
package/dist/module.css CHANGED
@@ -34,6 +34,7 @@
34
34
  --color-warning: var(--warning);
35
35
  --color-danger: var(--danger);
36
36
  --color-info: var(--info);
37
+ --color-merged: var(--merged);
37
38
 
38
39
  /* The shadcn sidebar reads its own `--sidebar-*` family so a sidebar can be themed apart from
39
40
  the page. Its background is its own (`--sidebar`: in the dark theme a step below the page, as
@@ -0,0 +1,33 @@
1
+ /**
2
+ * The words the dashboard keeps for itself, after a project's address and in its place: `overview`,
3
+ * a project's Overview, and `settings` (#958), where Settings was a page. Settings is a dialog over
4
+ * the page you are on now, carried as `?settings=`; the old address still opens it, over the
5
+ * Overview. No module's page takes either.
6
+ */
7
+ export declare const OVERVIEW_SEGMENT = "overview";
8
+ export declare const SETTINGS_SEGMENT = "settings";
9
+ /**
10
+ * Whether a segment can name a page a module adds (#1774): a lowercase letter, then lowercase
11
+ * letters and digits, and not a word the dashboard keeps. Whichever module claims the segment gets
12
+ * it, and the shell says "no such page" when none does, or when the picked project has no package
13
+ * that adds it.
14
+ */
15
+ export declare function isPageSegment(segment: string): boolean;
16
+ /** Each registered project's address, and the project an address or an id names. */
17
+ export interface ProjectAddresses {
18
+ /** The project's address: its name, or its id where the name cannot be one. An unknown id is its own address. */
19
+ addressOf(projectId: string): string;
20
+ /** The project a first segment names, by its address or by its id; undefined for none. */
21
+ projectOf(segment: string): string | undefined;
22
+ }
23
+ /**
24
+ * The addresses of the registered projects, in the registry's order, beside the pages' words.
25
+ * A project's name is its id without the `-<hash>`: its folder's name, as the id writes it. The
26
+ * name is its address unless a page has that word, since pages win, or a project before it in the
27
+ * registry already has that name: the first one added keeps it, so adding a second clone changes
28
+ * no address in use.
29
+ */
30
+ export declare function projectAddresses(projectIds: readonly string[], pageWords: readonly string[]): ProjectAddresses;
31
+ /** No project registered: every first segment is a page's, or a project's nobody registered. */
32
+ export declare const NO_PROJECTS: ProjectAddresses;
33
+ //# sourceMappingURL=project-address.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"project-address.d.ts","sourceRoot":"","sources":["../src/project-address.ts"],"names":[],"mappings":"AAUA;;;;;GAKG;AACH,eAAO,MAAM,gBAAgB,aAAa,CAAA;AAC1C,eAAO,MAAM,gBAAgB,aAAa,CAAA;AAE1C;;;;;GAKG;AACH,wBAAgB,aAAa,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAEtD;AAED,oFAAoF;AACpF,MAAM,WAAW,gBAAgB;IAC/B,iHAAiH;IACjH,SAAS,CAAC,SAAS,EAAE,MAAM,GAAG,MAAM,CAAA;IACpC,0FAA0F;IAC1F,SAAS,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,CAAA;CAC/C;AAED;;;;;;GAMG;AACH,wBAAgB,gBAAgB,CAAC,UAAU,EAAE,SAAS,MAAM,EAAE,EAAE,SAAS,EAAE,SAAS,MAAM,EAAE,GAAG,gBAAgB,CAe9G;AAED,gGAAgG;AAChG,eAAO,MAAM,WAAW,EAAE,gBAA2C,CAAA"}
@@ -0,0 +1,57 @@
1
+ // A project's address in the dashboard's URL (#784): what the page shows, and what `openagent`
2
+ // prints for a project it opens, so the two say one thing.
3
+ //
4
+ // A project's address is its folder's name: the id with its `-<hash>` off. The id itself is the
5
+ // address only where the name cannot be one: a project before it in the registry has the same
6
+ // folder name, or the name is a page's word. Only the address is a name: the id stays what
7
+ // preferences, records and other machines know the project by, and it still opens the project.
8
+ //
9
+ // Pure and browser-safe: the dashboard imports it, and so does the server.
10
+ /**
11
+ * The words the dashboard keeps for itself, after a project's address and in its place: `overview`,
12
+ * a project's Overview, and `settings` (#958), where Settings was a page. Settings is a dialog over
13
+ * the page you are on now, carried as `?settings=`; the old address still opens it, over the
14
+ * Overview. No module's page takes either.
15
+ */
16
+ export const OVERVIEW_SEGMENT = 'overview';
17
+ export const SETTINGS_SEGMENT = 'settings';
18
+ /**
19
+ * Whether a segment can name a page a module adds (#1774): a lowercase letter, then lowercase
20
+ * letters and digits, and not a word the dashboard keeps. Whichever module claims the segment gets
21
+ * it, and the shell says "no such page" when none does, or when the picked project has no package
22
+ * that adds it.
23
+ */
24
+ export function isPageSegment(segment) {
25
+ return /^[a-z][a-z0-9]*$/.test(segment) && segment !== OVERVIEW_SEGMENT && segment !== SETTINGS_SEGMENT;
26
+ }
27
+ /**
28
+ * The addresses of the registered projects, in the registry's order, beside the pages' words.
29
+ * A project's name is its id without the `-<hash>`: its folder's name, as the id writes it. The
30
+ * name is its address unless a page has that word, since pages win, or a project before it in the
31
+ * registry already has that name: the first one added keeps it, so adding a second clone changes
32
+ * no address in use.
33
+ */
34
+ export function projectAddresses(projectIds, pageWords) {
35
+ const taken = new Set([OVERVIEW_SEGMENT, SETTINGS_SEGMENT, ...pageWords, ...projectIds]);
36
+ const byId = new Map();
37
+ const byAddress = new Map();
38
+ for (const id of projectIds) {
39
+ const name = nameOf(id);
40
+ const address = name && !taken.has(name) ? name : id;
41
+ taken.add(address);
42
+ byId.set(id, address);
43
+ byAddress.set(address, id);
44
+ }
45
+ return {
46
+ addressOf: id => byId.get(id) ?? id,
47
+ projectOf: segment => byAddress.get(segment) ?? (byId.has(segment) ? segment : undefined),
48
+ };
49
+ }
50
+ /** No project registered: every first segment is a page's, or a project's nobody registered. */
51
+ export const NO_PROJECTS = projectAddresses([], []);
52
+ /** A project id's name: the id without its last `-<hash>`; empty for an id with no dash. */
53
+ function nameOf(projectId) {
54
+ const dash = projectId.lastIndexOf('-');
55
+ return dash > 0 ? projectId.slice(0, dash) : '';
56
+ }
57
+ //# sourceMappingURL=project-address.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"project-address.js","sourceRoot":"","sources":["../src/project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C,EAAE,CAAC,IAAI,EAAE;QACnC,SAAS,EAAE,OAAO,CAAC,EAAE,CAAC,SAAS,CAAC,GAAG,CAAC,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,SAAS,CAAC;KAC1F,CAAA;AACH,CAAC;AAED,gGAAgG;AAChG,MAAM,CAAC,MAAM,WAAW,GAAqB,gBAAgB,CAAC,EAAE,EAAE,EAAE,CAAC,CAAA;AAErE,4FAA4F;AAC5F,SAAS,MAAM,CAAC,SAAiB;IAC/B,MAAM,IAAI,GAAG,SAAS,CAAC,WAAW,CAAC,GAAG,CAAC,CAAA;IACvC,OAAO,IAAI,GAAG,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC,KAAK,CAAC,CAAC,EAAE,IAAI,CAAC,CAAC,CAAC,CAAC,EAAE,CAAA;AACjD,CAAC"}
package/dist/serve.d.ts CHANGED
@@ -1,2 +1,4 @@
1
1
  export { DEFAULT_DAEMON_PORT, runDaemon, type DaemonState, type RunDaemonOptions } from './daemon.js';
2
+ export { joinRunningDashboard, type JoinedDashboard } from './join-dashboard.js';
3
+ export type { StartedProject } from './dashboard/types.js';
2
4
  //# sourceMappingURL=serve.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"serve.d.ts","sourceRoot":"","sources":["../src/serve.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,mBAAmB,EAAE,SAAS,EAAE,KAAK,WAAW,EAAE,KAAK,gBAAgB,EAAE,MAAM,aAAa,CAAA"}
1
+ {"version":3,"file":"serve.d.ts","sourceRoot":"","sources":["../src/serve.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,mBAAmB,EAAE,SAAS,EAAE,KAAK,WAAW,EAAE,KAAK,gBAAgB,EAAE,MAAM,aAAa,CAAA;AACrG,OAAO,EAAE,oBAAoB,EAAE,KAAK,eAAe,EAAE,MAAM,qBAAqB,CAAA;AAChF,YAAY,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAA"}
package/dist/serve.js CHANGED
@@ -2,4 +2,5 @@
2
2
  // no command of its own: the one people run is start's, which hands it the skills every run gets
3
3
  // (in the environment, see `SKILLS_ENV`) and OpenAgent's version.
4
4
  export { DEFAULT_DAEMON_PORT, runDaemon } from './daemon.js';
5
+ export { joinRunningDashboard } from './join-dashboard.js';
5
6
  //# sourceMappingURL=serve.js.map
package/dist/serve.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"serve.js","sourceRoot":"","sources":["../src/serve.ts"],"names":[],"mappings":"AAAA,qGAAqG;AACrG,iGAAiG;AACjG,kEAAkE;AAClE,OAAO,EAAE,mBAAmB,EAAE,SAAS,EAA2C,MAAM,aAAa,CAAA"}
1
+ {"version":3,"file":"serve.js","sourceRoot":"","sources":["../src/serve.ts"],"names":[],"mappings":"AAAA,qGAAqG;AACrG,iGAAiG;AACjG,kEAAkE;AAClE,OAAO,EAAE,mBAAmB,EAAE,SAAS,EAA2C,MAAM,aAAa,CAAA;AACrG,OAAO,EAAE,oBAAoB,EAAwB,MAAM,qBAAqB,CAAA"}
@@ -151,6 +151,19 @@ export interface AgentMeta {
151
151
  * machine can ask whether the process is alive.
152
152
  */
153
153
  saving?: boolean;
154
+ /**
155
+ * How the run's pull request stands ({@link pr}), as the git host last said. Not stored: annotated
156
+ * on the way to the dashboard like {@link saving}, since it changes on the git host, not here.
157
+ */
158
+ prState?: 'open' | 'draft' | 'merged' | 'closed';
159
+ /**
160
+ * How many commits of the run's own wait on its branch, never pushed: its work has not left this
161
+ * machine. Not stored: annotated on the way to the dashboard like {@link prState}, since a push
162
+ * changes it, not the run.
163
+ */
164
+ unpublished?: number;
165
+ /** How many files the run's checkout left uncommitted, annotated like {@link unpublished}. */
166
+ uncommitted?: number;
154
167
  /**
155
168
  * The loopback port the agent's browser preview is listening on (#813), or absent when the agent
156
169
  * has no browser. What lets the daemon proxy the pane: the port is allocated per agent and the
@@ -1 +1 @@
1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E,EAAE,EAAE,IAAI,EAAE,QAAQ,CAAC,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,EAAE,CAAC,KAAK,CAAC,EAAE,KAAK,OAAO,CAAC,CAAA;AAC3F,CAAC"}
@@ -13,10 +13,12 @@
13
13
  * `<command> show [--from <commit>] <branch>...` what each branch holds and where it stands, as an array of {@link BranchState}, in the order asked;
14
14
  * measured from `<commit>`, where the branches started, in place of the default branch;
15
15
  * a full commit id in place of a branch is read as a branch that ends there
16
+ * `<command> ahead [--from <commit>] <branch>...` how far each branch is past the base, whether the remote has it, and what its checkout left uncommitted,
17
+ * as an array of {@link BranchAhead}: no file lists, so every run's branch can be asked on a poll
16
18
  * `<command> merge <b>` merge the branch into the default branch, on this machine, then delete it
17
19
  * `<command> push --branch <b>` push the branch to the remote; a branch only the remote has is answered as it is
18
20
  * `<command> remove <id> [--from <commit>] [--discard]` reclaim a run's checkout once its branch holds everything, pushing nothing, its branch measured from the commit it started from; `--discard` drops uncommitted work
19
- * `list` and `show` read this machine, no network: OpenAgent polls. `show` answers the branch's
21
+ * `list`, `show` and `ahead` read this machine, no network: OpenAgent polls. `show` answers the branch's
20
22
  * git facts only; its pull request is the git host provider's (`git-host.ts`), as every pull request is.
21
23
  *
22
24
  * That is the whole contract: git, and nothing beyond it (#1820). OpenAgent reads checkouts to
@@ -24,7 +26,7 @@
24
26
  * the Human Queue's unpushed rows. Opening a pull request is the push here, then the git host
25
27
  * provider's `open`. What a checkout is, where it lives, how a branch is pushed is the package's.
26
28
  *
27
- * The shapes, owned here: {@link Checkout}, {@link BranchState}.
29
+ * The shapes, owned here: {@link Checkout}, {@link BranchState}, {@link BranchAhead}.
28
30
  */
29
31
  /** A run's checkout: where it works, as a provider lists it. */
30
32
  export interface Checkout {
@@ -74,6 +76,26 @@ export interface BranchState {
74
76
  /** The uncommitted paths in the checkout that is on this branch; absent when no checkout is. */
75
77
  pendingFiles?: string[];
76
78
  }
79
+ /** How far a branch is past its base and whether the remote has it, as a provider answers `ahead`: counts, no files. */
80
+ export interface BranchAhead {
81
+ branch: string;
82
+ /** The branch exists on this machine. */
83
+ exists: boolean;
84
+ /** A branch the provider made for a run, not one of the person's own. */
85
+ agent: boolean;
86
+ /** How many commits of its own it has beyond the base. */
87
+ ahead: number;
88
+ /** The project has a remote to push to. */
89
+ hasRemote: boolean;
90
+ /** The remote has the branch at this same tip. */
91
+ pushed: boolean;
92
+ /** It was pushed, and the remote's copy is gone since, as a merged pull request's is. */
93
+ gone: boolean;
94
+ /** The project's default branch already contains it. */
95
+ merged: boolean;
96
+ /** How many paths the run's checkout on it left uncommitted; 0 with no checkout. */
97
+ uncommitted: number;
98
+ }
77
99
  /** What pushing a branch did: `pushed` is false when only the remote had it, so there was nothing here to push. */
78
100
  export type PushOutcome = {
79
101
  ok: true;
@@ -124,6 +146,8 @@ export interface BranchesSource {
124
146
  * branch that ended there held.
125
147
  */
126
148
  show(branches: readonly string[], from?: string): Promise<BranchState[]>;
149
+ /** How far each branch is past its base and whether the remote has it, in the order asked; `[]` when nothing can be read. `from` as for {@link show}. */
150
+ ahead(branches: readonly string[], from?: string): Promise<BranchAhead[]>;
127
151
  /** Push a branch to the remote: the checkout on it under its clean rule, else the branch itself. */
128
152
  push(branch: string): Promise<PushOutcome>;
129
153
  /** Merge a branch into the project's default branch, on this machine, then delete it; a merge that conflicts changes nothing. */
@@ -148,6 +172,8 @@ export type BranchesReader = BranchesFor & {
148
172
  export declare function parseCheckouts(output: unknown): Checkout[];
149
173
  /** The states read back from a provider's `show`: the objects with a branch and the three verdicts, lists cleaned; anything else is no state. */
150
174
  export declare function parseBranchStates(output: unknown): BranchState[];
175
+ /** The counts read back from a provider's `ahead`: the objects with a branch and every verdict; anything else is no answer. */
176
+ export declare function parseBranchesAhead(output: unknown): BranchAhead[];
151
177
  /**
152
178
  * The production {@link BranchesReader}: the project's provider, looked up among the packages the project has (`built-in.ts`),
153
179
  * one source per project kept while the same command provides — so the cache holds across the
@@ -1 +1 @@
1
- {"version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AAA;IAC5C;;;;OAIG;IACH,MAAM,CAAC,EAAE,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE;QAAE,OAAO,CAAC,EAAE,OAAO,CAAC;QAAC,IAAI,CAAC,EAAE,MAAM,CAAA;KAAE,GAAG,OAAO,CAAC,aAAa,CAAC,CAAA;CACxF;AAED,sGAAsG;AACtG,MAAM,MAAM,WAAW,GAAG,CAAC,IAAI,EAAE,MAAM,KAAK,OAAO,CAAC,cAAc,GAAG,SAAS,CAAC,CAAA;AAE/E,wHAAwH;AACxH,MAAM,MAAM,cAAc,GAAG,WAAW,GAAG;IAAE,OAAO,CAAC,IAAI,EAAE,MAAM,GAAG,IAAI,CAAA;CAAE,CAAA;AAQ1E,gJAAgJ;AAChJ,wBAAgB,cAAc,CAAC,MAAM,EAAE,OAAO,GAAG,QAAQ,EAAE,CAiB1D;AAED,iJAAiJ;AACjJ,wBAAgB,iBAAiB,CAAC,MAAM,EAAE,OAAO,GAAG,WAAW,EAAE,CAqBhE;AAED,+HAA+H;AAC/H,wBAAgB,kBAAkB,CAAC,MAAM,EAAE,OAAO,GAAG,WAAW,EAAE,CASjE;AAoGD;;;;;;;GAOG;AACH,wBAAgB,gBAAgB,CAAC,GAAG,GAAE,MAAM,MAAiB,GAAG,cAAc,CAa7E;AAED,+FAA+F;AAC/F,eAAO,MAAM,eAAe,EAAE,cAAmC,CAAA;AAEjE,0EAA0E;AAC1E,eAAO,MAAM,UAAU,EAAE,WAAmC,CAAA"}
@@ -53,6 +53,19 @@ export function parseBranchStates(output) {
53
53
  }
54
54
  return states;
55
55
  }
56
+ /** The counts read back from a provider's `ahead`: the objects with a branch and every verdict; anything else is no answer. */
57
+ export function parseBranchesAhead(output) {
58
+ if (!Array.isArray(output))
59
+ return [];
60
+ return output.flatMap(value => {
61
+ const row = (value && typeof value === 'object' ? value : {});
62
+ const flags = ['exists', 'agent', 'hasRemote', 'pushed', 'gone', 'merged'];
63
+ if (typeof row['branch'] !== 'string' || row['branch'] === '' || typeof row['ahead'] !== 'number' || typeof row['uncommitted'] !== 'number' || flags.some(flag => typeof row[flag] !== 'boolean'))
64
+ return [];
65
+ const flag = (name) => row[name] === true;
66
+ return [{ branch: row['branch'], exists: flag('exists'), agent: flag('agent'), ahead: row['ahead'], hasRemote: flag('hasRemote'), pushed: flag('pushed'), gone: flag('gone'), merged: flag('merged'), uncommitted: row['uncommitted'] }];
67
+ });
68
+ }
56
69
  function commitsOf(value) {
57
70
  if (!Array.isArray(value))
58
71
  return [];
@@ -81,10 +94,31 @@ function filesOf(value) {
81
94
  /** The branches source over one provider command: each read one run of the command, cached per {@link CACHE_MS}; each write drops the reads. */
82
95
  function commandBranches(root, command, now) {
83
96
  const listed = new Map();
84
- const shown = new Map();
97
+ const read = new Map();
85
98
  const drop = () => {
86
99
  listed.clear();
87
- shown.clear();
100
+ read.clear();
101
+ };
102
+ // A read of branches by name, `show` or `ahead`: concurrent and recent asks of the same branches share one process; a read that failed is not kept.
103
+ const branchRead = (verb, parse, branches, from) => {
104
+ const asked = branches.filter(branch => branch !== '');
105
+ if (asked.length === 0)
106
+ return Promise.resolve([]);
107
+ const key = [verb, from ?? '', ...asked].join('\0');
108
+ const known = read.get(key);
109
+ if (known && now() - known.at < CACHE_MS)
110
+ return known.answer;
111
+ const entry = { at: now(), answer: Promise.resolve([]) };
112
+ entry.answer = runPackageCommand(root, command, [verb, ...(from ? ['--from', from] : []), ...asked]).then(result => {
113
+ if (!result.ok || !Array.isArray(result.output)) {
114
+ if (read.get(key) === entry)
115
+ read.delete(key);
116
+ return [];
117
+ }
118
+ return parse(result.output);
119
+ });
120
+ read.set(key, entry);
121
+ return entry.answer;
88
122
  };
89
123
  return {
90
124
  drop,
@@ -106,26 +140,8 @@ function commandBranches(root, command, now) {
106
140
  listed.set(key, read);
107
141
  return read.rows;
108
142
  },
109
- show(branches, from) {
110
- const asked = branches.filter(branch => branch !== '');
111
- if (asked.length === 0)
112
- return Promise.resolve([]);
113
- const key = [from ?? '', ...asked].join('\0');
114
- const known = shown.get(key);
115
- if (known && now() - known.at < CACHE_MS)
116
- return known.states;
117
- const read = { at: now(), states: Promise.resolve([]) };
118
- read.states = runPackageCommand(root, command, ['show', ...(from ? ['--from', from] : []), ...asked]).then(result => {
119
- if (!result.ok || !Array.isArray(result.output)) {
120
- if (shown.get(key) === read)
121
- shown.delete(key);
122
- return [];
123
- }
124
- return parseBranchStates(result.output);
125
- });
126
- shown.set(key, read);
127
- return read.states;
128
- },
143
+ show: (branches, from) => branchRead('show', parseBranchStates, branches, from),
144
+ ahead: (branches, from) => branchRead('ahead', parseBranchesAhead, branches, from),
129
145
  async push(branch) {
130
146
  const result = await runPackageCommand(root, command, ['push', '--branch', branch]);
131
147
  drop();