@1agh/maude 2.1.0 → 2.1.1

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 (100) hide show
  1. package/apps/studio/access/request.ts +1 -0
  2. package/apps/studio/actions/agents.ts +27 -0
  3. package/apps/studio/actions/defs/app.ts +28 -1
  4. package/apps/studio/actions/defs/sync.ts +4 -0
  5. package/apps/studio/actions.manifest.json +60 -2
  6. package/apps/studio/actions.parity.json +13 -1
  7. package/apps/studio/bin/_curl-local.mjs +7 -4
  8. package/apps/studio/client/app.jsx +16 -4
  9. package/apps/studio/client/home/HomeAccountsRow.jsx +221 -0
  10. package/apps/studio/client/home/HomeConnection.jsx +111 -0
  11. package/apps/studio/client/home/home-accounts-model.js +110 -1
  12. package/apps/studio/client/home/home-api.js +6 -2
  13. package/apps/studio/client/home/home-app.jsx +74 -12
  14. package/apps/studio/client/home/home-model.js +40 -1
  15. package/apps/studio/client/home/home-where-model.js +105 -0
  16. package/apps/studio/client/home/home.css +233 -1
  17. package/apps/studio/client/hooks/use-palette-and-panels.jsx +3 -1
  18. package/apps/studio/client/hooks/use-tabs.jsx +11 -4
  19. package/apps/studio/client/panels/TeamProjects.jsx +137 -134
  20. package/apps/studio/client/share-link.js +12 -0
  21. package/apps/studio/client/styles/_index.css +4 -0
  22. package/apps/studio/client/v2/diagnostics/diagnostics-host.jsx +1 -0
  23. package/apps/studio/client/v2/diagnostics/diagnostics-model.js +32 -2
  24. package/apps/studio/client/v2/diagnostics/diagnostics-sheet.jsx +35 -8
  25. package/apps/studio/client/v2/diagnostics/diagnostics.css +34 -0
  26. package/apps/studio/client/v2/diagnostics/sync-details/sync-details-model.js +94 -3
  27. package/apps/studio/client/v2/diagnostics/sync-details/sync-details.jsx +187 -4
  28. package/apps/studio/client/v2/link-server/LinkServerDialog.jsx +492 -0
  29. package/apps/studio/client/v2/link-server/LinkServerHost.jsx +42 -0
  30. package/apps/studio/client/v2/link-server/link-server-api.js +142 -0
  31. package/apps/studio/client/v2/link-server/link-server-model.js +438 -0
  32. package/apps/studio/client/v2/link-server/link-server.css +109 -0
  33. package/apps/studio/client/v2/onboarding/AdvancedSheets.jsx +31 -86
  34. package/apps/studio/client/v2/onboarding/onboarding-model.js +1 -18
  35. package/apps/studio/client/v2/search/search-keywords.js +3 -2
  36. package/apps/studio/client/v2/settings/account.jsx +4 -2
  37. package/apps/studio/client/v2/settings/advanced-section.jsx +245 -148
  38. package/apps/studio/client/v2/settings/connection-row.jsx +3 -59
  39. package/apps/studio/client/v2/settings/connections-section.jsx +118 -425
  40. package/apps/studio/client/v2/settings/general-section.jsx +138 -43
  41. package/apps/studio/client/v2/settings/project-sync-settings.jsx +4 -3
  42. package/apps/studio/client/v2/settings/reset-section.jsx +14 -3
  43. package/apps/studio/client/v2/settings/settings-card.jsx +142 -0
  44. package/apps/studio/client/v2/settings/settings-cards.js +220 -0
  45. package/apps/studio/client/v2/settings/settings-handlers.js +7 -6
  46. package/apps/studio/client/v2/settings/settings-model.js +91 -31
  47. package/apps/studio/client/v2/settings/settings-sheet.jsx +25 -6
  48. package/apps/studio/client/v2/settings/settings.css +374 -64
  49. package/apps/studio/client/v2/settings/this-project-card.jsx +730 -0
  50. package/apps/studio/client/v2/settings/this-project-model.js +172 -0
  51. package/apps/studio/client/v2/settings/use-connections.js +3 -2
  52. package/apps/studio/client/v2/settings/use-open-card.js +37 -0
  53. package/apps/studio/client/v2/shell/connection-state.js +197 -0
  54. package/apps/studio/client/v2/shell/menu-runner.js +7 -2
  55. package/apps/studio/client/v2/shell/project-account-bus.js +36 -0
  56. package/apps/studio/client/v2/shell/project-account-card.jsx +357 -148
  57. package/apps/studio/client/v2/shell/project-account-model.js +272 -149
  58. package/apps/studio/client/v2/shell/project-account-toast.js +66 -0
  59. package/apps/studio/client/v2/shell/project-account.css +237 -0
  60. package/apps/studio/client/v2/shell/share-cluster-host.jsx +166 -83
  61. package/apps/studio/client/v2/shell/shell-parity.js +3 -2
  62. package/apps/studio/client/v2/shell/shell-parity.json +40 -26
  63. package/apps/studio/client/v2/shell/use-account.js +2 -0
  64. package/apps/studio/client/v2/signin/use-signin.js +1 -1
  65. package/apps/studio/cloud/endpoints.ts +29 -4
  66. package/apps/studio/dist/client.bundle.js +834 -834
  67. package/apps/studio/dist/styles.css +1 -1
  68. package/apps/studio/home/accounts.ts +30 -11
  69. package/apps/studio/home/cloud.ts +6 -1
  70. package/apps/studio/home/hub-health.ts +76 -0
  71. package/apps/studio/home/routes.ts +9 -3
  72. package/apps/studio/http.ts +8 -0
  73. package/apps/studio/migrate/hub.ts +8 -1
  74. package/apps/studio/routes/hub-link-folder.ts +334 -0
  75. package/apps/studio/routes/hub-signin.ts +78 -1
  76. package/apps/studio/routes/index.ts +4 -0
  77. package/apps/studio/routes/sync.ts +22 -4
  78. package/apps/studio/shell/api-key.ts +11 -0
  79. package/apps/studio/sync/accepted-cold-start.ts +144 -8
  80. package/apps/studio/sync/action-stage.ts +18 -1
  81. package/apps/studio/sync/ctl-heal.ts +58 -0
  82. package/apps/studio/sync/file-ledger.ts +38 -4
  83. package/apps/studio/sync/file-plane.ts +226 -19
  84. package/apps/studio/sync/held-deletes.ts +86 -5
  85. package/apps/studio/sync/hub-link.ts +8 -0
  86. package/apps/studio/sync/index.ts +68 -4
  87. package/apps/studio/sync/link-consent.ts +22 -75
  88. package/apps/studio/sync/link-survey.ts +252 -0
  89. package/apps/studio/sync/local-kernel.ts +16 -1
  90. package/apps/studio/sync/seed-progress.ts +12 -0
  91. package/apps/studio/sync/source-recovery.ts +18 -2
  92. package/apps/studio/sync/status.ts +11 -1
  93. package/apps/studio/sync/writer-registry.ts +5 -0
  94. package/apps/studio/whats-new.json +18 -0
  95. package/cli/lib/bash-guard.mjs +19 -0
  96. package/cli/lib/design-help.gen.mjs +1 -1
  97. package/package.json +9 -8
  98. package/apps/studio/client/v2/onboarding/HubSheet.jsx +0 -212
  99. package/apps/studio/client/v2/shell/account-card-model.js +0 -114
  100. package/apps/studio/client/v2/shell/account-card.jsx +0 -189
@@ -3,9 +3,12 @@
3
3
  // shell command a sheet's button runs. Each sheet is a view (exported from ./index.js for S11.14), so Settings ›
4
4
  // Connections mounts the same sheets with its own wiring.
5
5
  //
6
- // hub → /_home/hub/test; Sign in (#204 K2) → /_home/hub/signin/start, the shell opens the hub's
7
- // own page (`open_team_server_signin`; with an invite, the hub's invite page), poll until
8
- // the browser came back, then /_home/hub/prepare and Home's own open of the managed copy
6
+ // hub → the one "Link your server" dialog (2.1.1 T5, v2/link-server/; it replaced HubSheet):
7
+ // /_home/hub/test as the address is typed; Sign in (#204 K2) → /_home/hub/signin/start,
8
+ // the shell opens the hub's own page (`open_team_server_signin`; with an invite, the hub's
9
+ // invite page), poll until the browser came back, then /_home/hub/prepare and Home's own
10
+ // open of the managed copy. Home has no sign-in-key or folder path (named gap), so the
11
+ // dialog draws no Advanced here.
9
12
  // folder-github → the shell's folder picker (`open_project_folder`); "From GitHub" (S6.10) → Rust's
10
13
  // github_repos / home_github_sign_in / github_clone / github_create, then `open_project({root})`
11
14
  // ai → /_home/ai/{status,connect} (install Claude Code, then the browser sign-in)
@@ -16,7 +19,7 @@
16
19
  // own page in the browser takes it, issue #204); the AI sign-in is the person's browser; nothing here stores
17
20
  // a token.
18
21
 
19
- import { useCallback, useEffect, useRef, useState } from 'react';
22
+ import { useCallback, useEffect, useMemo, useRef, useState } from 'react';
20
23
 
21
24
  import {
22
25
  aiConnect,
@@ -39,9 +42,9 @@ import { ConnectAiSheet } from './ConnectAiSheet.jsx';
39
42
  import { CliSheet } from './CliSheet.jsx';
40
43
  import { FigmaSheet } from './FigmaSheet.jsx';
41
44
  import { FolderGithubSheet } from './FolderGithubSheet.jsx';
42
- import { HubSheet } from './HubSheet.jsx';
45
+ import { answerOf, checkAnswerOf } from '../link-server/link-server-model.js';
46
+ import { LinkServerDialog } from '../link-server/LinkServerDialog.jsx';
43
47
  import { connectClaudeHome } from './connect-ai-home.js';
44
- import { HUB_WORDS } from './onboarding-model.js';
45
48
 
46
49
  const CLI_POLL_MS = 1500;
47
50
 
@@ -189,89 +192,31 @@ function FigmaHost({ target, onClose, startFigma }) {
189
192
  export const HUB_POLL_MS = 1500;
190
193
 
191
194
  /**
192
- * #204 K2 — the hub sheet's host: Sign in opens the hub's own page and waits for the browser to come back to
193
- * Home's server; Cancel forgets the attempt (a late return then changes nothing). `pollMs` is a test seam.
195
+ * Home's "Link your server" API (2.1.1 T5): the same dialog a project tab opens, wired to Home's own routes
196
+ * for `profile`. `finish` prepares the managed copy and opens it as a tab (Home's `openPrepared`).
194
197
  */
195
- function HubHost({ onClose, profile, openPrepared, pollMs = HUB_POLL_MS }) {
196
- const attempt = useRef(null); // { id, stop: (r) => void }
197
- useEffect(
198
- () => () => {
199
- const a = attempt.current;
200
- attempt.current = null;
201
- if (a) {
202
- a.stop({ ok: false, cancelled: true });
203
- void hubSignInCancel(a.id);
204
- }
198
+ export function homeLinkApi({ profile, openPrepared }) {
199
+ return {
200
+ context: 'home',
201
+ folders: false,
202
+ check: async (url) => checkAnswerOf(await hubTest(url)),
203
+ signInStart: async (url, invite) => answerOf(await hubSignInStart(profile, url, invite)),
204
+ signInPoll: async (id) => answerOf(await hubSignInPoll(id)),
205
+ signInCancel: (id) => hubSignInCancel(id),
206
+ openSignIn: openTeamServerSignIn,
207
+ finish: async (url) => {
208
+ const r = await hubPrepare(profile, url);
209
+ if (!r.ok || !r.json?.ok) return { ok: false, error: r.json?.error };
210
+ await openPrepared(r, r.json.name, profile);
211
+ return { ok: true };
205
212
  },
206
- []
207
- );
208
-
209
- const waitForBrowser = (id) =>
210
- new Promise((resolve) => {
211
- let timer = null;
212
- const stop = (r) => {
213
- clearTimeout(timer);
214
- resolve(r);
215
- };
216
- attempt.current = { id, stop };
217
- const tick = async () => {
218
- const p = await hubSignInPoll(id);
219
- if (attempt.current?.id !== id) return; // cancelled meanwhile
220
- if (p.json?.pending) {
221
- timer = setTimeout(tick, pollMs);
222
- return;
223
- }
224
- attempt.current = null;
225
- stop(
226
- p.ok && p.json?.ok && p.json.url
227
- ? { ok: true, url: p.json.url }
228
- : { ok: false, error: p.json?.error || HUB_WORDS.unreachable }
229
- );
230
- };
231
- timer = setTimeout(tick, 0); // the first ask at once, then every pollMs
232
- });
213
+ };
214
+ }
233
215
 
234
- return (
235
- <HubSheet
236
- onCancel={onClose}
237
- onTest={async (url) => {
238
- const r = await hubTest(url);
239
- return r.json?.ok
240
- ? { ok: true, version: r.json.version ?? null }
241
- : { ok: false, error: r.json?.error || HUB_WORDS.unreachable };
242
- }}
243
- onSignIn={async ({ url, invite, onWaiting }) => {
244
- const s = await hubSignInStart(profile, url, invite);
245
- if (!s.ok || !s.json?.ok)
246
- return { ok: false, error: s.json?.error || HUB_WORDS.unreachable };
247
- const id = s.json.id;
248
- const opened = await openTeamServerSignIn(s.json.signInUrl);
249
- if (opened !== 'ok') {
250
- void hubSignInCancel(id);
251
- return {
252
- ok: false,
253
- error: opened === 'refused' ? HUB_WORDS.refused : HUB_WORDS.noBrowser,
254
- };
255
- }
256
- onWaiting();
257
- const done = await waitForBrowser(id);
258
- if (!done.ok) return done;
259
- const r = await hubPrepare(profile, done.url);
260
- if (!r.ok || !r.json?.ok)
261
- return { ok: false, error: r.json?.error || HUB_WORDS.unreachable };
262
- await openPrepared(r, r.json.name, profile);
263
- onClose();
264
- return { ok: true };
265
- }}
266
- onAbortSignIn={() => {
267
- const a = attempt.current;
268
- attempt.current = null;
269
- if (!a) return;
270
- void hubSignInCancel(a.id);
271
- a.stop({ ok: false, cancelled: true });
272
- }}
273
- />
274
- );
216
+ /** #204 K2 + 2.1.1 T5 — the hub row's host: the one dialog with Home's API. `pollMs` is a test seam. */
217
+ function HubHost({ onClose, profile, openPrepared, pollMs = HUB_POLL_MS }) {
218
+ const api = useMemo(() => homeLinkApi({ profile, openPrepared }), [profile, openPrepared]);
219
+ return <LinkServerDialog api={api} onClose={onClose} pollMs={pollMs} />;
275
220
  }
276
221
 
277
222
  /**
@@ -3,24 +3,7 @@
3
3
  // main button ("Connect to your own hub" → Connect). Advanced language (addresses, commands, keys) is allowed
4
4
  // here and only here (the canvas's note 15).
5
5
 
6
- // Issue #204: one Sign in — the hub's own page in the browser; no email or password field in the app.
7
- export const HUB_WORDS = {
8
- title: 'Sign in to your own hub',
9
- verb: 'Sign in',
10
- busy: 'Signing in…',
11
- addressLabel: 'Hub address',
12
- test: 'Test connection',
13
- testing: 'Testing…',
14
- reachable: (version) => (version ? `Reachable — hub ${version}` : 'Reachable'),
15
- inviteLabel: 'Invite link or key (if you have one)',
16
- invitePlaceholder: 'Invite link or key',
17
- waiting: 'Finish signing in in your browser.',
18
- refused: 'That address can’t be opened. Check the hub address.',
19
- noBrowser: 'The browser didn’t open. Try again.',
20
- fine: 'Sign in opens the hub’s own sign-in page in your browser. Maude Cloud stays signed in too.',
21
- unreachable: "Couldn't reach that hub. Check the address, or whether it's online.",
22
- };
23
-
6
+ // The hub sheet's words moved with it to the one "Link your server" dialog (2.1.1 T5, v2/link-server/).
24
7
  export const FOLDER_WORDS = {
25
8
  title: 'Open a folder or a GitHub project',
26
9
  verb: 'Open',
@@ -114,8 +114,9 @@ export const SETTINGS_SEARCH = Object.freeze({
114
114
  keywords: ['hub', 'cloud', 'server', 'url', 'self hosted'],
115
115
  },
116
116
  'settings-team-server-add': {
117
- label: 'Add a team server…',
118
- keywords: ['hub', 'self hosted', 'server', 'team', 'invite'],
117
+ // 2.1.1 T6 (canvas 17 · 09): General › This project's own words
118
+ label: 'Link your server…',
119
+ keywords: ['hub', 'self hosted', 'server', 'team', 'invite', 'add a team server'],
119
120
  },
120
121
  'settings-app-version': { label: 'Version', keywords: ['app version', 'about', 'build'] },
121
122
  'settings-update-restart': {
@@ -1,4 +1,6 @@
1
- // client/v2/settings/account.jsx — S9.20: Settings › General › Account (02 ob-settings, left card).
1
+ // client/v2/settings/account.jsx — S9.20: the account block (02 ob-settings, left card). 2.1.1 T6: on the
2
+ // desktop it sits in Settings › General › This project › Sync details › Maude Cloud; a cloud tab (no This
3
+ // project card) keeps it as General's Account card.
2
4
  //
3
5
  // Account
4
6
  // (Y) you@studio.cz · Signed in to cloud.maude.sh
@@ -107,7 +109,7 @@ export function AccountBlock({
107
109
  {ownAccount && (
108
110
  <Row
109
111
  label={signedIn ? (who ?? 'You') : host}
110
- hint={signedIn ? undefined : 'Sign in under Connections to sync projects.'}
112
+ hint={signedIn ? undefined : 'Sign in to Maude Cloud above to sync projects.'}
111
113
  >
112
114
  <span data-testid="settings-account-state">
113
115
  {signedIn ? `Signed in to ${host}` : 'Not signed in'}