@sealant/mend 0.36.0-next.754 → 0.36.0-next.761

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 (95) hide show
  1. package/README.md +17 -8
  2. package/dist/{chunk-ARGA4E7A.js → chunk-D4JBBLJV.js} +77 -3
  3. package/dist/{dashboard-JGR77HVG.js → dashboard-4BJL72T6.js} +16 -27
  4. package/dist/main.js +659 -214
  5. package/man/mend-accounts.1 +1 -1
  6. package/man/mend-adopt.1 +1 -1
  7. package/man/mend-attach.1 +1 -1
  8. package/man/mend-codex.1 +1 -1
  9. package/man/mend-completions.1 +1 -1
  10. package/man/mend-connect-pi.1 +1 -1
  11. package/man/mend-connect.1 +1 -1
  12. package/man/mend-continue.1 +1 -1
  13. package/man/mend-doctor.1 +1 -1
  14. package/man/mend-dotfiles-repo.1 +1 -1
  15. package/man/mend-dotfiles-sync.1 +1 -1
  16. package/man/mend-dotfiles.1 +1 -1
  17. package/man/mend-env-cluster.1 +1 -1
  18. package/man/mend-env-load.1 +1 -1
  19. package/man/mend-env-show.1 +1 -1
  20. package/man/mend-folder-create.1 +1 -1
  21. package/man/mend-folder-list.1 +1 -1
  22. package/man/mend-folder-push.1 +1 -1
  23. package/man/mend-folder-rm.1 +1 -1
  24. package/man/mend-git-author.1 +1 -1
  25. package/man/mend-help.1 +1 -1
  26. package/man/mend-invite.1 +1 -1
  27. package/man/mend-keys-init.1 +1 -1
  28. package/man/mend-keys-mode.1 +1 -1
  29. package/man/mend-keys-share.1 +1 -1
  30. package/man/mend-keys-show.1 +1 -1
  31. package/man/mend-land.1 +1 -1
  32. package/man/mend-login.1 +1 -1
  33. package/man/mend-logout.1 +1 -1
  34. package/man/mend-logs.1 +1 -1
  35. package/man/mend-man.1 +1 -1
  36. package/man/mend-members.1 +1 -1
  37. package/man/mend-memory-import.1 +1 -1
  38. package/man/mend-memory-rm.1 +1 -1
  39. package/man/mend-memory-show.1 +1 -1
  40. package/man/mend-memory.1 +1 -1
  41. package/man/mend-models.1 +1 -1
  42. package/man/mend-operator-exposure.1 +1 -1
  43. package/man/mend-operator-gate.1 +1 -1
  44. package/man/mend-operator-grant-owner.1 +1 -1
  45. package/man/mend-operator-org-create.1 +1 -1
  46. package/man/mend-operator-org-invite-owner.1 +1 -1
  47. package/man/mend-operator-org-list.1 +1 -1
  48. package/man/mend-operator-org-rename.1 +1 -1
  49. package/man/mend-operator-reset-link.1 +1 -1
  50. package/man/mend-pair.1 +1 -1
  51. package/man/mend-projects.1 +1 -1
  52. package/man/mend-pull.1 +1 -1
  53. package/man/mend-refresh.1 +1 -1
  54. package/man/mend-rejoin.1 +1 -1
  55. package/man/mend-resume.1 +1 -1
  56. package/man/mend-run.1 +1 -1
  57. package/man/mend-secrets-add.1 +1 -1
  58. package/man/mend-secrets-rm.1 +1 -1
  59. package/man/mend-secrets.1 +1 -1
  60. package/man/mend-server-logs.1 +1 -1
  61. package/man/mend-server-restart.1 +1 -1
  62. package/man/mend-server-setup.1 +6 -4
  63. package/man/mend-server-start.1 +1 -1
  64. package/man/mend-server-status.1 +1 -1
  65. package/man/mend-server-stop.1 +1 -1
  66. package/man/mend-server-upgrade.1 +1 -1
  67. package/man/mend-server.1 +1 -1
  68. package/man/mend-service-add.1 +1 -1
  69. package/man/mend-service-connect.1 +1 -1
  70. package/man/mend-service-init.1 +1 -1
  71. package/man/mend-service-list.1 +1 -1
  72. package/man/mend-service-logs.1 +1 -1
  73. package/man/mend-service-restart.1 +1 -1
  74. package/man/mend-service-run.1 +1 -1
  75. package/man/mend-service-stop.1 +1 -1
  76. package/man/mend-session-share.1 +1 -1
  77. package/man/mend-sessions.1 +1 -1
  78. package/man/mend-shell.1 +1 -1
  79. package/man/mend-skills-push.1 +1 -1
  80. package/man/mend-skills.1 +1 -1
  81. package/man/mend-snake.1 +1 -1
  82. package/man/mend-ssh-keys-remove.1 +1 -1
  83. package/man/mend-ssh-keys.1 +1 -1
  84. package/man/mend-ssh-setup.1 +1 -1
  85. package/man/mend-ssh.1 +12 -3
  86. package/man/mend-stop.1 +1 -1
  87. package/man/mend-ui.1 +1 -1
  88. package/man/mend-uninstall.1 +1 -1
  89. package/man/mend-version.1 +1 -1
  90. package/man/mend-wait.1 +1 -1
  91. package/man/mend-workspace-replace.1 +1 -1
  92. package/man/mend-worktrees-rm.1 +1 -1
  93. package/man/mend-worktrees.1 +1 -1
  94. package/man/mend.1 +2 -2
  95. package/package.json +2 -2
package/README.md CHANGED
@@ -242,6 +242,7 @@ dev instance with `MEND_STATIC_TOKEN` set, `MEND_TOKEN=<that value>` also works.
242
242
  ```sh
243
243
  mend ssh # inspect config and this client's key registration
244
244
  mend ssh setup # register a key and reconcile this server's Host block
245
+ mend ssh 3f2a9c1e # print the exact ssh command for one session's workspace
245
246
  mend ssh setup --key ./my-key # explicitly select private key or its .pub file
246
247
  mend ssh setup --host mend.example.com
247
248
  mend ssh keys # your registered keys, from every machine; this one is marked
@@ -249,9 +250,15 @@ mend ssh keys remove SHA256:… # stop the gateway accepting one of them
249
250
  ```
250
251
 
251
252
  Setup puts the managed block before wildcard defaults and restores all-host scope before your
252
- original configuration. It preserves other servers and hand-written Host/Match rules. If moving an
253
- older block would change the scope of trailing directives, it refuses the write; put those
254
- directives in an explicit Host or Match block and rerun setup.
253
+ original configuration. It preserves other servers and hand-written Host/Match rules. An older
254
+ release's unscoped `Host mend-ws` block is migrated only when it points at this server's gateway
255
+ (the same HostName and Port); one for another server stays.
256
+
257
+ The gateway's user names the workspace, `ws-<workspace id>`, and no other output shows that id: the
258
+ Docker container's name is a different one, and the gateway closes such a connection after its
259
+ banner. `mend ssh <session>` prints the exact command, on stdout alone. If moving an older block
260
+ would change the scope of trailing directives, it refuses the write; put those directives in an
261
+ explicit Host or Match block and rerun setup.
255
262
 
256
263
  Relative `--key` paths resolve against the invoking directory; `~/` resolves against your home.
257
264
  Identity paths with spaces, quotes, backslashes and literal `%` are escaped for OpenSSH. Control
@@ -277,11 +284,13 @@ until it ends. The key file and this server's `~/.ssh/config` block stay on the
277
284
  registered it; `mend ssh setup` there registers it again.
278
285
 
279
286
  `mend uninstall --home` removes the key this machine registered before it revokes the terminal's
280
- device token, then deletes the key file and the managed block. The key is found by its public half,
281
- so an encrypted private key or a stopped agent does not hide it. When the server refuses the
282
- removal, or this machine's public key cannot be read, the uninstall still finishes and exits 1,
283
- naming the fingerprint that may still be registered and `mend ssh keys remove` to run from another
284
- signed-in machine.
287
+ device token, then deletes the key file and the signed-in server's managed block. Other servers'
288
+ blocks and an older release's unscoped `Host mend-ws` block stay (uninstall says how to delete the
289
+ latter by hand), and so does the key file while a block that stays signs with it. The key is found
290
+ by its public half, so an encrypted private key or a stopped agent does not hide it. When the server
291
+ refuses the removal, or this machine's public key cannot be read, the uninstall still finishes and
292
+ exits 1, naming the fingerprint that may still be registered and `mend ssh keys remove` to run from
293
+ another signed-in machine.
285
294
 
286
295
  ### Gateway host-key rotation
287
296
 
@@ -7,6 +7,15 @@ var __export = (target, all3) => {
7
7
  // ../../packages/domain/src/workbench/harness-launch.ts
8
8
  var EFFORT_LEVELS = ["low", "medium", "high", "xhigh", "max", "ultra"];
9
9
  var PERMISSION_MODES = ["bypass", "ask"];
10
+ var PROMPTABLE_HARNESSES = /* @__PURE__ */ new Set([
11
+ "claude",
12
+ "codex",
13
+ "opencode",
14
+ "pi"
15
+ ]);
16
+ var takesReviewFollowUp = (harness) => PROMPTABLE_HARNESSES.has(harness);
17
+ var noReviewFollowUpLine = (harness) => `This ${harness} session has no agent to send the review to. Start an agent in this worktree, then send it.`;
18
+ var resumesOwnHarness = (harness) => PROMPTABLE_HARNESSES.has(harness) || harness === "shell";
10
19
 
11
20
  // ../../packages/domain/src/workbench/agent-start.ts
12
21
  var agentStartingLine = (label, facts, elapsedMs) => `${label} is starting${facts.freshMachine ? " on the new machine" : ""} \xB7 ${Math.max(0, Math.round(elapsedMs / 1e3))}s`;
@@ -26759,6 +26768,19 @@ var repositoryCloneUrlIssue = (value3) => {
26759
26768
  if (repositoryUrlHasCredential(value3)) return REPOSITORY_URL_CREDENTIAL_GUIDANCE;
26760
26769
  return null;
26761
26770
  };
26771
+ var gitRemoteLocation = (value3) => {
26772
+ if (repositoryCloneUrlIssue(value3) !== null) return null;
26773
+ if (!value3.includes("://")) {
26774
+ const hostPart = value3.slice(value3.indexOf("@") + 1, value3.lastIndexOf(":"));
26775
+ const host2 = hostPart.startsWith("[") ? hostPart.slice(1, -1) : hostPart;
26776
+ return { scheme: "ssh", host: host2.toLowerCase(), port: null };
26777
+ }
26778
+ const url = new URL(value3);
26779
+ const scheme = url.protocol.slice(0, -1);
26780
+ if (scheme !== "http" && scheme !== "https" && scheme !== "ssh" && scheme !== "git") return null;
26781
+ const host = url.hostname.startsWith("[") ? url.hostname.slice(1, -1) : url.hostname;
26782
+ return { scheme, host: host.toLowerCase(), port: url.port === "" ? null : Number(url.port) };
26783
+ };
26762
26784
  var RepositoryCloneUrl = Schema_exports.String.pipe(
26763
26785
  Schema_exports.check(Schema_exports.makeFilter((value3) => repositoryCloneUrlIssue(value3) ?? void 0)),
26764
26786
  Schema_exports.brand("RepositoryCloneUrl")
@@ -26967,6 +26989,20 @@ var agentMemoryNameOf = (filePath) => {
26967
26989
  }
26968
26990
  return null;
26969
26991
  };
26992
+ var agentMemoryPathOf = (name) => {
26993
+ if (name.startsWith(".")) return name;
26994
+ const qualified = /^([a-z]+):(.+)$/.exec(name);
26995
+ const harness = qualified?.[1] ?? null;
26996
+ const rest = qualified?.[2] ?? name;
26997
+ const single = AGENT_MEMORY_FILES.find(
26998
+ (file) => (harness === null || file.harness === harness) && file.path.endsWith(`/${rest}`)
26999
+ );
27000
+ if (single !== void 0) return single.path;
27001
+ const root = AGENT_MEMORY_ROOTS.find(
27002
+ (candidate) => candidate.harness === (harness ?? "claude")
27003
+ )?.root;
27004
+ return root === void 0 ? name : `${root}/${rest}`;
27005
+ };
26970
27006
 
26971
27007
  // ../../packages/domain/src/workbench/connected-credential.ts
26972
27008
  var CLAUDE_GRANT_SECTION = "claudeAiOauth";
@@ -28671,7 +28707,7 @@ var ProjectClusterBindingsSnapshot = class extends Schema_exports.Class(
28671
28707
  }) {
28672
28708
  };
28673
28709
 
28674
- // ../../node_modules/.pnpm/@sealant+api-contracts-next@0.39.0-next.720_effect@4.0.0-beta.93/node_modules/@sealant/api-contracts-next/dist/workspace-environment.js
28710
+ // ../../node_modules/.pnpm/@sealant+api-contracts-next@0.39.0-next.721_effect@4.0.0-beta.93/node_modules/@sealant/api-contracts-next/dist/workspace-environment.js
28675
28711
  var RESERVED_NAMES = new Map([
28676
28712
  // Identity/process roots the daemon and shells own.
28677
28713
  ...[
@@ -29773,6 +29809,39 @@ var serviceViewStatus = (view) => {
29773
29809
  };
29774
29810
  var serviceViewHostPort = (view) => (view.endpoints.find((candidate) => candidate.scope === "private") ?? view.endpoints[0] ?? null)?.hostPort ?? null;
29775
29811
 
29812
+ // src/dashboard-adoption.ts
29813
+ var deriveAdoptOffer = (facts) => {
29814
+ if (facts.repoRoot === null || facts.originUrl === null || repositoryCloneUrlIssue(facts.originUrl) !== null)
29815
+ return null;
29816
+ return {
29817
+ source: RepositoryCloneUrl.make(facts.originUrl),
29818
+ name: normalizeProjectName(facts.repoRoot.split("/").at(-1) ?? "project"),
29819
+ modeIndex: 0
29820
+ };
29821
+ };
29822
+ var submitDashboardAdoption = async (api, input) => {
29823
+ const issue = repositoryCloneUrlIssue(input.source);
29824
+ if (issue !== null) return { kind: "invalid-source", message: issue };
29825
+ const project = await api("POST", "/projects", {
29826
+ name: input.name,
29827
+ source: RepositoryCloneUrl.make(input.source),
29828
+ gitAuthMode: input.gitAuthMode
29829
+ });
29830
+ return { kind: "adopted", project };
29831
+ };
29832
+ var adoptedGitAuth = (source, mode) => {
29833
+ if (mode === "ambient") return null;
29834
+ const signer = mode === "mend-key" ? "your Mend key" : "the connected `mend keys share`";
29835
+ const location = gitRemoteLocation(source);
29836
+ if (location !== null && location.scheme !== "ssh") {
29837
+ return {
29838
+ value: location.scheme,
29839
+ note: `cloned over ${location.scheme}, which ${signer} does not sign; it signs ssh remotes`
29840
+ };
29841
+ }
29842
+ return mode === "mend-key" ? { value: "mend key", note: "your Mend key signed this clone" } : { value: "bridge", note: "signed through the connected `mend keys share`" };
29843
+ };
29844
+
29776
29845
  // src/server-request.ts
29777
29846
  var MendRequestError = class extends Error {
29778
29847
  kind;
@@ -30006,18 +30075,20 @@ var eventFamilies = (payload) => {
30006
30075
  };
30007
30076
 
30008
30077
  export {
30078
+ takesReviewFollowUp,
30079
+ noReviewFollowUpLine,
30080
+ resumesOwnHarness,
30009
30081
  agentStartingLine,
30010
30082
  agentStartingFacts,
30011
30083
  repositoryCloneUrlIssue,
30012
- RepositoryCloneUrl,
30013
30084
  landingFactsFromWire,
30014
30085
  landingFactLine,
30015
30086
  AGENT_MEMORY_ROOTS,
30016
- AGENT_MEMORY_FILES,
30017
30087
  CODEX_MEMORY_DATABASE,
30018
30088
  AGENT_MEMORY_MAX_FILE_BYTES,
30019
30089
  AGENT_MEMORY_MAX_DATABASE_BYTES,
30020
30090
  agentMemoryNameOf,
30091
+ agentMemoryPathOf,
30021
30092
  checkpointSourceWords,
30022
30093
  narrowCredential,
30023
30094
  claudeGrantFacts,
@@ -30076,6 +30147,9 @@ export {
30076
30147
  serviceViewAttempt,
30077
30148
  serviceViewStatus,
30078
30149
  serviceViewHostPort,
30150
+ deriveAdoptOffer,
30151
+ submitDashboardAdoption,
30152
+ adoptedGitAuth,
30079
30153
  MendRequestError,
30080
30154
  spoken,
30081
30155
  noAnswerError,
@@ -1,32 +1,35 @@
1
1
  import {
2
2
  HARNESS_COMMANDS,
3
3
  LIVE_STATUSES,
4
- RepositoryCloneUrl,
5
4
  agentIsLive,
6
5
  agentOutcome,
7
6
  captureLineOf,
8
7
  checkpointSourceWords,
9
8
  createSseParser,
10
9
  cwdFacts,
10
+ deriveAdoptOffer,
11
11
  eventFamilies,
12
12
  hasPersonFacts,
13
13
  isPendingId,
14
14
  launchPhaseOf,
15
15
  matchProjectByCwd,
16
16
  mayStillBeWorking,
17
+ noReviewFollowUpLine,
17
18
  normalizeProjectName,
18
19
  pendingId,
19
- repositoryCloneUrlIssue,
20
+ resumesOwnHarness,
20
21
  serviceViewHostPort,
21
22
  serviceViewStatus,
22
23
  servicesHoldLine,
23
24
  sessionWorkspaceLines,
25
+ submitDashboardAdoption,
26
+ takesReviewFollowUp,
24
27
  withoutLaunchPhase,
25
28
  workspaceLineList,
26
29
  workspaceReadsOf,
27
30
  worktreeJoinLine,
28
31
  wrapWords
29
- } from "./chunk-ARGA4E7A.js";
32
+ } from "./chunk-D4JBBLJV.js";
30
33
 
31
34
  // src/dashboard.tsx
32
35
  import { CliRenderEvents, createCliRenderer } from "@opentui/core";
@@ -40,27 +43,6 @@ import {
40
43
  } from "@tanstack/react-query";
41
44
  import { useEffect as useEffect3, useMemo as useMemo2, useRef as useRef2, useState as useState3, useSyncExternalStore } from "react";
42
45
 
43
- // src/dashboard-adoption.ts
44
- var deriveAdoptOffer = (facts) => {
45
- if (facts.repoRoot === null || facts.originUrl === null || repositoryCloneUrlIssue(facts.originUrl) !== null)
46
- return null;
47
- return {
48
- source: RepositoryCloneUrl.make(facts.originUrl),
49
- name: normalizeProjectName(facts.repoRoot.split("/").at(-1) ?? "project"),
50
- modeIndex: 0
51
- };
52
- };
53
- var submitDashboardAdoption = async (api, input) => {
54
- const issue = repositoryCloneUrlIssue(input.source);
55
- if (issue !== null) return { kind: "invalid-source", message: issue };
56
- const project = await api("POST", "/projects", {
57
- name: input.name,
58
- source: RepositoryCloneUrl.make(input.source),
59
- gitAuthMode: input.gitAuthMode
60
- });
61
- return { kind: "adopted", project };
62
- };
63
-
64
46
  // src/dashboard-model.ts
65
47
  var serviceRowOf = (view) => ({
66
48
  id: view.service.id,
@@ -219,12 +201,15 @@ var pseudoGroup = (session, item) => ({
219
201
  var deriveHarnesses = (resuming, joining = null) => {
220
202
  if (resuming !== null) {
221
203
  const others = Object.keys(HARNESS_COMMANDS).filter((h) => h !== resuming.harness);
222
- return [
204
+ const same2 = resumesOwnHarness(resuming.harness) ? [
223
205
  {
224
206
  harness: null,
225
207
  label: resuming.harness,
226
208
  hint: "same harness \xB7 native resume, conversation intact"
227
- },
209
+ }
210
+ ] : [];
211
+ return [
212
+ ...same2,
228
213
  ...others.map(
229
214
  (harness) => ({
230
215
  harness,
@@ -1916,6 +1901,10 @@ function ReviewScreen({
1916
1901
  };
1917
1902
  const openSendEditor = () => {
1918
1903
  if (data === void 0) return;
1904
+ if (!takesReviewFollowUp(session.harness)) {
1905
+ setStatus(noReviewFollowUpLine(session.harness));
1906
+ return;
1907
+ }
1919
1908
  const sendable = data.comments.filter(
1920
1909
  (comment) => comment.state === "open" && comment.sentToSessionId === null && !isPendingId(comment.id)
1921
1910
  );
@@ -2375,7 +2364,7 @@ function ReviewScreen({
2375
2364
  onSubmit: () => void submitEditor()
2376
2365
  }
2377
2366
  ),
2378
- /* @__PURE__ */ jsx("text", { height: 1, fg: status === "" ? FAINT : INK_2, bg: "transparent", children: status === "" ? ` m read \xB7 g suggest \xB7 t tour \xB7 ,/. tour stops \xB7 s draft review${data.followUp?.status === "pending" ? " \xB7 y deliver & relaunch" : ""} \xB7 o web \xB7 r refresh` : ` ${status}` }),
2367
+ /* @__PURE__ */ jsx("text", { height: 1, fg: status === "" ? FAINT : INK_2, bg: "transparent", children: status === "" ? ` m read \xB7 g suggest \xB7 t tour \xB7 ,/. tour stops${takesReviewFollowUp(session.harness) ? " \xB7 s draft review" : ""}${data.followUp?.status === "pending" ? " \xB7 y deliver & relaunch" : ""} \xB7 o web \xB7 r refresh` : ` ${status}` }),
2379
2368
  /* @__PURE__ */ jsx("text", { height: 1, fg: FAINT, bg: "transparent", children: footer })
2380
2369
  ] })
2381
2370
  );