@otto-code/client 0.7.2 → 0.7.4

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.
@@ -923,7 +923,9 @@ export declare class DaemonClient {
923
923
  requestId?: string;
924
924
  }): Promise<ArchiveWorkspacePayload>;
925
925
  workspaceArchivePreflight(workspaceId: string, requestId?: string): Promise<WorkspaceArchivePreflightPayload>;
926
- setWorktreeBaseRef(workspaceId: string, baseRef: string | null, requestId?: string): Promise<WorktreeBaseRefSetPayload>;
926
+ setWorktreeBaseRef(workspaceId: string, baseRef: string | null, options?: {
927
+ redetect?: boolean;
928
+ }, requestId?: string): Promise<WorktreeBaseRefSetPayload>;
927
929
  listReattachableWorktrees(scope: {
928
930
  projectId?: string;
929
931
  cwd?: string;
@@ -1075,6 +1077,14 @@ export declare class DaemonClient {
1075
1077
  setWorkspaceTitle(workspaceId: string, title: string | null, requestId?: string): Promise<{
1076
1078
  title: string | null;
1077
1079
  }>;
1080
+ /**
1081
+ * Moves a chat to another workspace over the same directory. Throws with the
1082
+ * daemon's reason when refused; the same-directory rule is enforced there, not
1083
+ * here, so the caller gets one explanation rather than two.
1084
+ */
1085
+ transferAgentWorkspace(agentId: string, workspaceId: string, requestId?: string): Promise<{
1086
+ workspaceId: string;
1087
+ }>;
1078
1088
  listProjectLinks(requestId?: string): Promise<ProjectLink[]>;
1079
1089
  linkProjects(projectId: string, otherProjectId: string, requestId?: string): Promise<ProjectLink[]>;
1080
1090
  unlinkProjects(projectId: string, otherProjectId: string, requestId?: string): Promise<ProjectLink[]>;
@@ -1360,10 +1370,14 @@ export declare class DaemonClient {
1360
1370
  undoCodeRename(cwd: string, runId: string, requestId?: string): Promise<CodeRenameUndoOutcome>;
1361
1371
  /**
1362
1372
  * Live language-server state for the Daemon → Code screen: what this host can
1363
- * supply, and what is running now. `cwd` scopes availability, since a server can
1364
- * be present in one workspace's `node_modules` and absent in another's.
1373
+ * supply, and what is running now.
1374
+ *
1375
+ * Omit `cwd` for the host-wide answer the settings screen wants: every row the daemon
1376
+ * knows, resolved against the rungs a host has. Pass one only to additionally probe that
1377
+ * project's `node_modules/.bin`, the single rung that is genuinely per-project.
1378
+ * Requires features.lspHostServers when omitted.
1365
1379
  */
1366
- listLspServers(cwd: string, requestId?: string): Promise<LspServersSnapshot>;
1380
+ listLspServers(cwd?: string, requestId?: string): Promise<LspServersSnapshot>;
1367
1381
  /** Stop one running language server. */
1368
1382
  stopLspServer(rootPath: string, serverId: string, requestId?: string): Promise<void>;
1369
1383
  /**
@@ -1117,16 +1117,21 @@ export class DaemonClient {
1117
1117
  responseType: "workspace.archive.preflight.response",
1118
1118
  });
1119
1119
  }
1120
- // Repoint a worktree-backed workspace's base branch (what Changes diffs against,
1121
- // and what merge-into-base / PR creation target). Pass null to reset to the
1122
- // repository default. Gated by server_info.features.worktreeDiffBase.
1123
- async setWorktreeBaseRef(workspaceId, baseRef, requestId) {
1120
+ // Repoint a workspace's base branch (what Changes diffs against, and what
1121
+ // merge-into-base / PR creation target). Pass null to reset to the repository
1122
+ // default, or `redetect` to forget the stored base and detect the branch's parent
1123
+ // again. An `origin/` prefix is preserved: `main` and `origin/main` are different
1124
+ // comparisons whenever local and origin have drifted.
1125
+ // Gated by server_info.features.worktreeDiffBase; repointing a plain (non-worktree)
1126
+ // checkout additionally needs server_info.features.checkoutDiffBaseAnyRepo.
1127
+ async setWorktreeBaseRef(workspaceId, baseRef, options, requestId) {
1124
1128
  return this.sendCorrelatedSessionRequest({
1125
1129
  requestId,
1126
1130
  message: {
1127
1131
  type: "worktree.baseRef.set.request",
1128
1132
  workspaceId,
1129
1133
  baseRef,
1134
+ ...(options?.redetect ? { redetect: true } : {}),
1130
1135
  },
1131
1136
  responseType: "worktree.baseRef.set.response",
1132
1137
  });
@@ -1703,6 +1708,26 @@ export class DaemonClient {
1703
1708
  }
1704
1709
  return { title: payload.title };
1705
1710
  }
1711
+ /**
1712
+ * Moves a chat to another workspace over the same directory. Throws with the
1713
+ * daemon's reason when refused; the same-directory rule is enforced there, not
1714
+ * here, so the caller gets one explanation rather than two.
1715
+ */
1716
+ async transferAgentWorkspace(agentId, workspaceId, requestId) {
1717
+ const payload = await this.sendCorrelatedSessionRequest({
1718
+ requestId,
1719
+ message: {
1720
+ type: "agent.workspace.transfer.request",
1721
+ agentId,
1722
+ workspaceId,
1723
+ },
1724
+ responseType: "agent.workspace.transfer.response",
1725
+ });
1726
+ if (!payload.accepted || !payload.workspaceId) {
1727
+ throw new Error(payload.error ?? "Failed to move chat");
1728
+ }
1729
+ return { workspaceId: payload.workspaceId };
1730
+ }
1706
1731
  async listProjectLinks(requestId) {
1707
1732
  const payload = await this.sendNamespacedCorrelatedSessionRequest({
1708
1733
  requestId,
@@ -3441,8 +3466,12 @@ export class DaemonClient {
3441
3466
  }
3442
3467
  /**
3443
3468
  * Live language-server state for the Daemon → Code screen: what this host can
3444
- * supply, and what is running now. `cwd` scopes availability, since a server can
3445
- * be present in one workspace's `node_modules` and absent in another's.
3469
+ * supply, and what is running now.
3470
+ *
3471
+ * Omit `cwd` for the host-wide answer the settings screen wants: every row the daemon
3472
+ * knows, resolved against the rungs a host has. Pass one only to additionally probe that
3473
+ * project's `node_modules/.bin`, the single rung that is genuinely per-project.
3474
+ * Requires features.lspHostServers when omitted.
3446
3475
  */
3447
3476
  async listLspServers(cwd, requestId) {
3448
3477
  const payload = await this.sendCorrelatedSessionRequest({
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@otto-code/client",
3
- "version": "0.7.2",
3
+ "version": "0.7.4",
4
4
  "description": "Otto client SDK package",
5
5
  "license": "AGPL-3.0-or-later",
6
6
  "files": [
@@ -36,8 +36,8 @@
36
36
  "test": "vitest run"
37
37
  },
38
38
  "dependencies": {
39
- "@otto-code/protocol": "0.7.2",
40
- "@otto-code/relay": "0.7.2",
39
+ "@otto-code/protocol": "0.7.4",
40
+ "@otto-code/relay": "0.7.4",
41
41
  "zod": "^4.4.3"
42
42
  },
43
43
  "devDependencies": {