@try-works/dsh-recursive-mode 0.1.13 → 0.1.14

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.
@@ -106,11 +106,15 @@ export interface WorkspaceListStateLike {
106
106
  recentWorkspaceId?: string;
107
107
  }
108
108
  /**
109
- * Resolve the CURRENT workspace path for a workspace-scoped board (run 14):
110
- * the WORKSPACE owns the .recursive/ run-layer, not the session. Resolution:
111
- * 1) recentWorkspaceId's item path (the workspace the user is viewing), else
112
- * 2) the workspace whose sessionIds contains sessionList.current, else
113
- * 3) the workspace whose path === currentSessionCwd(sessionList), else
109
+ * Resolve the CURRENT workspace path for a workspace-scoped board (run 14,
110
+ * corrected run 16/0.1.14): the WORKSPACE owns the .recursive/ run-layer, not
111
+ * the session. Resolution mirrors the harness's startSession precedence
112
+ * (service.ts:183) the CURRENT session's workspace wins over the
113
+ * recentWorkspaceId (which the harness derives as the most recently ACTIVE
114
+ * workspace by session updatedAt, NOT the workspace being viewed):
115
+ * 1) the workspace whose sessionIds contains sessionList.current, else
116
+ * 2) the workspace whose path === currentSessionCwd(sessionList), else
117
+ * 3) recentWorkspaceId's item path (fallback ONLY when no current session resolves), else
114
118
  * 4) '' (empty -> the route returns null root -> board renders nothing).
115
119
  */
116
120
  export declare function currentWorkspacePath(list: WorkspaceListStateLike, sessionList: SessionListStateLike): string;
package/lib/client.js CHANGED
@@ -21,18 +21,18 @@ window.__ModuleLoader__.load({
21
21
  return state.current === void 0 ? "" : state.byId[state.current]?.cwd ?? "";
22
22
  }
23
23
  /**
24
- * Resolve the CURRENT workspace path for a workspace-scoped board (run 14):
25
- * the WORKSPACE owns the .recursive/ run-layer, not the session. Resolution:
26
- * 1) recentWorkspaceId's item path (the workspace the user is viewing), else
27
- * 2) the workspace whose sessionIds contains sessionList.current, else
28
- * 3) the workspace whose path === currentSessionCwd(sessionList), else
24
+ * Resolve the CURRENT workspace path for a workspace-scoped board (run 14,
25
+ * corrected run 16/0.1.14): the WORKSPACE owns the .recursive/ run-layer, not
26
+ * the session. Resolution mirrors the harness's startSession precedence
27
+ * (service.ts:183) the CURRENT session's workspace wins over the
28
+ * recentWorkspaceId (which the harness derives as the most recently ACTIVE
29
+ * workspace by session updatedAt, NOT the workspace being viewed):
30
+ * 1) the workspace whose sessionIds contains sessionList.current, else
31
+ * 2) the workspace whose path === currentSessionCwd(sessionList), else
32
+ * 3) recentWorkspaceId's item path (fallback ONLY when no current session resolves), else
29
33
  * 4) '' (empty -> the route returns null root -> board renders nothing).
30
34
  */
31
35
  function currentWorkspacePath(list, sessionList) {
32
- if (list.recentWorkspaceId !== void 0) {
33
- const recent = list.items.find((w) => w.workspaceId === list.recentWorkspaceId);
34
- if (recent !== void 0) return recent.path;
35
- }
36
36
  const current = sessionList.current;
37
37
  if (current !== void 0) {
38
38
  const bySession = list.items.find((w) => w.sessionIds.includes(current));
@@ -43,6 +43,10 @@ window.__ModuleLoader__.load({
43
43
  const byCwd = list.items.find((w) => w.path === cwd);
44
44
  if (byCwd !== void 0) return byCwd.path;
45
45
  }
46
+ if (list.recentWorkspaceId !== void 0) {
47
+ const recent = list.items.find((w) => w.workspaceId === list.recentWorkspaceId);
48
+ if (recent !== void 0) return recent.path;
49
+ }
46
50
  return "";
47
51
  }
48
52
  //#endregion
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@try-works/dsh-recursive-mode",
3
3
  "description": "recursive-mode workflow as a DeepSeek Harness bundle: RecursiveRuntime service + recursive_status tool",
4
- "version": "0.1.13",
4
+ "version": "0.1.14",
5
5
  "type": "module",
6
6
  "main": "lib/index.js",
7
7
  "types": "lib/index.d.ts",
@@ -125,18 +125,18 @@ export interface WorkspaceListStateLike {
125
125
  }
126
126
 
127
127
  /**
128
- * Resolve the CURRENT workspace path for a workspace-scoped board (run 14):
129
- * the WORKSPACE owns the .recursive/ run-layer, not the session. Resolution:
130
- * 1) recentWorkspaceId's item path (the workspace the user is viewing), else
131
- * 2) the workspace whose sessionIds contains sessionList.current, else
132
- * 3) the workspace whose path === currentSessionCwd(sessionList), else
128
+ * Resolve the CURRENT workspace path for a workspace-scoped board (run 14,
129
+ * corrected run 16/0.1.14): the WORKSPACE owns the .recursive/ run-layer, not
130
+ * the session. Resolution mirrors the harness's startSession precedence
131
+ * (service.ts:183) the CURRENT session's workspace wins over the
132
+ * recentWorkspaceId (which the harness derives as the most recently ACTIVE
133
+ * workspace by session updatedAt, NOT the workspace being viewed):
134
+ * 1) the workspace whose sessionIds contains sessionList.current, else
135
+ * 2) the workspace whose path === currentSessionCwd(sessionList), else
136
+ * 3) recentWorkspaceId's item path (fallback ONLY when no current session resolves), else
133
137
  * 4) '' (empty -> the route returns null root -> board renders nothing).
134
138
  */
135
139
  export function currentWorkspacePath(list: WorkspaceListStateLike, sessionList: SessionListStateLike): string {
136
- if (list.recentWorkspaceId !== undefined) {
137
- const recent = list.items.find((w) => w.workspaceId === list.recentWorkspaceId)
138
- if (recent !== undefined) return recent.path
139
- }
140
140
  const current = sessionList.current
141
141
  if (current !== undefined) {
142
142
  const bySession = list.items.find((w) => w.sessionIds.includes(current))
@@ -147,5 +147,9 @@ export function currentWorkspacePath(list: WorkspaceListStateLike, sessionList:
147
147
  const byCwd = list.items.find((w) => w.path === cwd)
148
148
  if (byCwd !== undefined) return byCwd.path
149
149
  }
150
+ if (list.recentWorkspaceId !== undefined) {
151
+ const recent = list.items.find((w) => w.workspaceId === list.recentWorkspaceId)
152
+ if (recent !== undefined) return recent.path
153
+ }
150
154
  return ''
151
155
  }