@try-works/dsh-recursive-mode 0.1.13 → 0.1.15
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.
- package/lib/client/contract.d.ts +9 -5
- package/lib/client.js +13 -9
- package/lib/index.js +3 -2
- package/package.json +1 -1
- package/src/client/contract.ts +13 -9
- package/src/live-route.ts +3 -2
package/lib/client/contract.d.ts
CHANGED
|
@@ -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
|
|
111
|
-
*
|
|
112
|
-
*
|
|
113
|
-
*
|
|
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
|
|
26
|
-
*
|
|
27
|
-
*
|
|
28
|
-
*
|
|
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/lib/index.js
CHANGED
|
@@ -6116,10 +6116,11 @@ function makeRecursiveRoutes(host) {
|
|
|
6116
6116
|
"cache-control": "no-cache",
|
|
6117
6117
|
connection: "keep-alive"
|
|
6118
6118
|
});
|
|
6119
|
-
const push = () => {
|
|
6119
|
+
const push = async () => {
|
|
6120
|
+
const projection = await host.snapshot(root);
|
|
6120
6121
|
const payload = {
|
|
6121
6122
|
root,
|
|
6122
|
-
projection
|
|
6123
|
+
projection,
|
|
6123
6124
|
revision: host.revision(root)
|
|
6124
6125
|
};
|
|
6125
6126
|
res.write("data: " + JSON.stringify(payload) + "\n\n");
|
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.
|
|
4
|
+
"version": "0.1.15",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "lib/index.js",
|
|
7
7
|
"types": "lib/index.d.ts",
|
package/src/client/contract.ts
CHANGED
|
@@ -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
|
|
130
|
-
*
|
|
131
|
-
*
|
|
132
|
-
*
|
|
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
|
}
|
package/src/live-route.ts
CHANGED
|
@@ -97,8 +97,9 @@ export function makeRecursiveRoutes(host: RecursiveRouteHost): readonly { kind:
|
|
|
97
97
|
const root = sessionId === undefined && cwd === '' ? null : await host.resolveRoot(sessionId, cwd)
|
|
98
98
|
if (root === null) { res.writeHead(200, { 'content-type': 'text/event-stream; charset=utf-8', 'cache-control': 'no-cache', connection: 'keep-alive' }); res.write('data: {"root":null,"projection":{},"revision":0}\n\n'); res.end(); return }
|
|
99
99
|
res.writeHead(200, { 'content-type': 'text/event-stream; charset=utf-8', 'cache-control': 'no-cache', connection: 'keep-alive' })
|
|
100
|
-
const push = (): void => {
|
|
101
|
-
const
|
|
100
|
+
const push = async (): Promise<void> => {
|
|
101
|
+
const projection = await host.snapshot(root)
|
|
102
|
+
const payload = { root, projection, revision: host.revision(root) }
|
|
102
103
|
res.write('data: ' + JSON.stringify(payload) + '\n\n')
|
|
103
104
|
}
|
|
104
105
|
const heartbeat = setInterval(() => { res.write(': ping\n\n') }, HEARTBEAT_MS)
|