@mind-harness/mh-workspace 0.1.4 → 0.1.6
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/README.md +1 -1
- package/lib/index.js +35 -4
- package/lib/typert.host.js +27 -3
- package/lib/typert.remote-client.d.ts +3 -0
- package/lib/typert.remote-client.js +20 -3
- package/lib/types/service.d.ts +2 -0
- package/locale/en.json +1 -1
- package/locale/zh.json +1 -1
- package/package.json +3 -3
package/README.md
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
# @mind-harness/mh-workspace
|
|
2
2
|
|
|
3
|
-
Lists your
|
|
3
|
+
Lists your Mind Harness Projects and gives each one a workspace; a Session started there begins with the Project's README and AGENTS.md.
|
|
4
4
|
|
|
5
5
|
This plugin is part of Mind Harness for DeepSeek Harness (dsh). Install [`@mind-harness/mh-bundle`](https://www.npmjs.com/package/@mind-harness/mh-bundle) rather than this package: the bundle installs it with the other plugins and adds the rows that load it. Configuration, versions and license are described there.
|
package/lib/index.js
CHANGED
|
@@ -9,7 +9,7 @@ import { defineDomain } from "@deepseek-ai/dsh-storage-domain";
|
|
|
9
9
|
//#region lib/types/config.js
|
|
10
10
|
const DEFAULT_HOME = "https://mindharness.com/";
|
|
11
11
|
const workspaceConfig = z.object({
|
|
12
|
-
memory: z.object({ home: z.string().default(DEFAULT_HOME).volatile().description("
|
|
12
|
+
memory: z.object({ home: z.string().default(DEFAULT_HOME).volatile().description("Mind Harness home page address. A new value is read on the next request, without restarting.") }).default({ home: DEFAULT_HOME }).description("The Mind Harness home this installation lists Projects from."),
|
|
13
13
|
projectsDir: z.string().description("Where each Project gets its workspace directory. Defaults to mh/projects under the dsh home.")
|
|
14
14
|
});
|
|
15
15
|
function projectsDirOf(config) {
|
|
@@ -194,7 +194,7 @@ function workingCopySentence(project) {
|
|
|
194
194
|
return `The working directory is a local working copy for the Project ${project}, not the Project itself: it starts empty and does not mirror the Project. Read the Project by opening its pages and change it through the actions they declare. Keep files on their way in or out here, such as downloads and files to upload; a file edited here is not in the Project until you upload it.`;
|
|
195
195
|
}
|
|
196
196
|
function signInSentence(home, gap) {
|
|
197
|
-
return `
|
|
197
|
+
return `Mind Harness at ${home} cannot show this Project to the browser (${gap}). Its README and AGENTS.md were not opened. Tell the person to sign in to Mind Harness in their browser, then continue; Mind Harness pages read before that show only what is public.`;
|
|
198
198
|
}
|
|
199
199
|
const UNREAD_SENTENCE = "The Project page could not be read, so its README and AGENTS.md were not opened; open the Project page to read them.";
|
|
200
200
|
//#endregion
|
|
@@ -250,12 +250,14 @@ let MhWorkspaceService = (() => {
|
|
|
250
250
|
let _syncProjects_decorators;
|
|
251
251
|
let _ensureWorkspace_decorators;
|
|
252
252
|
let _openPersonWindow_decorators;
|
|
253
|
+
let _startBrowser_decorators;
|
|
253
254
|
return class MhWorkspaceService extends _classSuper {
|
|
254
255
|
static {
|
|
255
256
|
const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
|
|
256
257
|
_syncProjects_decorators = [Remote];
|
|
257
258
|
_ensureWorkspace_decorators = [Remote];
|
|
258
259
|
_openPersonWindow_decorators = [Remote];
|
|
260
|
+
_startBrowser_decorators = [Remote];
|
|
259
261
|
__esDecorate(this, null, _syncProjects_decorators, {
|
|
260
262
|
kind: "method",
|
|
261
263
|
name: "syncProjects",
|
|
@@ -289,6 +291,17 @@ let MhWorkspaceService = (() => {
|
|
|
289
291
|
},
|
|
290
292
|
metadata: _metadata
|
|
291
293
|
}, null, _instanceExtraInitializers);
|
|
294
|
+
__esDecorate(this, null, _startBrowser_decorators, {
|
|
295
|
+
kind: "method",
|
|
296
|
+
name: "startBrowser",
|
|
297
|
+
static: false,
|
|
298
|
+
private: false,
|
|
299
|
+
access: {
|
|
300
|
+
has: (obj) => "startBrowser" in obj,
|
|
301
|
+
get: (obj) => obj.startBrowser
|
|
302
|
+
},
|
|
303
|
+
metadata: _metadata
|
|
304
|
+
}, null, _instanceExtraInitializers);
|
|
292
305
|
if (_metadata) Object.defineProperty(this, Symbol.metadata, {
|
|
293
306
|
enumerable: true,
|
|
294
307
|
configurable: true,
|
|
@@ -370,8 +383,26 @@ let MhWorkspaceService = (() => {
|
|
|
370
383
|
const target = url === void 0 || url === "" ? home : url;
|
|
371
384
|
if (target !== home && !this.listed.has(target)) throw unlisted(target);
|
|
372
385
|
if (!isWebUrl(target)) throw unreadable("address is not http or https");
|
|
373
|
-
|
|
374
|
-
|
|
386
|
+
let views;
|
|
387
|
+
try {
|
|
388
|
+
views = await this.browser().open("person", [{ url: target }], signal);
|
|
389
|
+
await this.browser().bringToFront("person");
|
|
390
|
+
} catch (error) {
|
|
391
|
+
if (error instanceof RemoteError) throw error;
|
|
392
|
+
throw unreadable(errorText(error));
|
|
393
|
+
}
|
|
394
|
+
const failed = views.find((view) => !("tab" in view) && typeof view.reason === "string");
|
|
395
|
+
if (failed !== void 0) throw unreadable(failed.reason);
|
|
396
|
+
}
|
|
397
|
+
/** The person pressed retry. A browser that exited starts again before the list is read. */
|
|
398
|
+
async startBrowser(signal) {
|
|
399
|
+
await this.ready;
|
|
400
|
+
if (signal.aborted) throw cancelled();
|
|
401
|
+
try {
|
|
402
|
+
await this.browser().startForPerson();
|
|
403
|
+
} catch (error) {
|
|
404
|
+
throw unreadable(errorText(error));
|
|
405
|
+
}
|
|
375
406
|
}
|
|
376
407
|
/**
|
|
377
408
|
* Keep the Session's Project context current and, on the first step of its
|
package/lib/typert.host.js
CHANGED
|
@@ -13,6 +13,8 @@ let _mind_harness_mh_workspace_mhWorkspace_openPersonWindow_parameter_0$schema$v
|
|
|
13
13
|
const _mind_harness_mh_workspace_mhWorkspace_openPersonWindow_parameter_0$schema = () => (_mind_harness_mh_workspace_mhWorkspace_openPersonWindow_parameter_0$schema$value ??= z.union([z.undefined(), z.string()]))
|
|
14
14
|
let _mind_harness_mh_workspace_mhWorkspace_openPersonWindow_result$schema$value
|
|
15
15
|
const _mind_harness_mh_workspace_mhWorkspace_openPersonWindow_result$schema = () => (_mind_harness_mh_workspace_mhWorkspace_openPersonWindow_result$schema$value ??= z.void())
|
|
16
|
+
let _mind_harness_mh_workspace_mhWorkspace_startBrowser_result$schema$value
|
|
17
|
+
const _mind_harness_mh_workspace_mhWorkspace_startBrowser_result$schema = () => (_mind_harness_mh_workspace_mhWorkspace_startBrowser_result$schema$value ??= z.void())
|
|
16
18
|
let _mind_harness_mh_workspace_mhWorkspace_syncProjects_result$schema$value
|
|
17
19
|
const _mind_harness_mh_workspace_mhWorkspace_syncProjects_result$schema = () => (_mind_harness_mh_workspace_mhWorkspace_syncProjects_result$schema$value ??= z.object({
|
|
18
20
|
'projects': z.array(z.object({
|
|
@@ -62,7 +64,7 @@ const $remote = createTypertRemoteInfo({
|
|
|
62
64
|
create: _mind_harness_mh_workspace_mhWorkspace_ensureWorkspace_result$schema,
|
|
63
65
|
jsonSchema: {"type":"object","properties":{"workspaceId":{"type":"string"}},"required":["workspaceId"],"additionalProperties":true},
|
|
64
66
|
},
|
|
65
|
-
sourceLocation: {"file":"packages/mh-workspace/src/service.ts","line":
|
|
67
|
+
sourceLocation: {"file":"packages/mh-workspace/src/service.ts","line":178,"column":9},
|
|
66
68
|
},
|
|
67
69
|
'mhWorkspace/openPersonWindow': {
|
|
68
70
|
service: 'mhWorkspace',
|
|
@@ -93,7 +95,22 @@ const $remote = createTypertRemoteInfo({
|
|
|
93
95
|
create: _mind_harness_mh_workspace_mhWorkspace_openPersonWindow_result$schema,
|
|
94
96
|
jsonSchemaError: 'typert tool schema: unsupported void value',
|
|
95
97
|
},
|
|
96
|
-
sourceLocation: {"file":"packages/mh-workspace/src/service.ts","line":
|
|
98
|
+
sourceLocation: {"file":"packages/mh-workspace/src/service.ts","line":187,"column":9},
|
|
99
|
+
},
|
|
100
|
+
'mhWorkspace/startBrowser': {
|
|
101
|
+
service: 'mhWorkspace',
|
|
102
|
+
description: 'The person pressed retry. A browser that exited starts again before the list is read.',
|
|
103
|
+
invocation: { kind: 'direct' },
|
|
104
|
+
parameters: [
|
|
105
|
+
],
|
|
106
|
+
cancellation: { parameter: 'signal' },
|
|
107
|
+
result: {
|
|
108
|
+
mode: 'strict',
|
|
109
|
+
typeSymbol: '@mind-harness/mh-workspace#mhWorkspace/startBrowser:result',
|
|
110
|
+
create: _mind_harness_mh_workspace_mhWorkspace_startBrowser_result$schema,
|
|
111
|
+
jsonSchemaError: 'typert tool schema: unsupported void value',
|
|
112
|
+
},
|
|
113
|
+
sourceLocation: {"file":"packages/mh-workspace/src/service.ts","line":211,"column":9},
|
|
97
114
|
},
|
|
98
115
|
'mhWorkspace/syncProjects': {
|
|
99
116
|
service: 'mhWorkspace',
|
|
@@ -108,7 +125,7 @@ const $remote = createTypertRemoteInfo({
|
|
|
108
125
|
create: _mind_harness_mh_workspace_mhWorkspace_syncProjects_result$schema,
|
|
109
126
|
jsonSchema: {"type":"object","properties":{"projects":{"type":"array","items":{"type":"object","properties":{"url":{"type":"string"},"name":{"type":"string"},"projectId":{"type":"string"},"workspaceId":{"type":"string"},"removed":{"type":"boolean","const":true,"description":"The person removed this Project's Workspace. It is not in the sidebar."}},"required":["url","name","projectId"],"additionalProperties":true}},"signedIn":{"type":"boolean","description":"The Memory home names a viewer. Signed out, the list holds only what is public."},"selfLogin":{"type":"boolean"}},"required":["projects","signedIn","selfLogin"],"additionalProperties":true},
|
|
110
127
|
},
|
|
111
|
-
sourceLocation: {"file":"packages/mh-workspace/src/service.ts","line":
|
|
128
|
+
sourceLocation: {"file":"packages/mh-workspace/src/service.ts","line":164,"column":9},
|
|
112
129
|
},
|
|
113
130
|
},
|
|
114
131
|
}, z)
|
|
@@ -148,6 +165,13 @@ export const TYPERT = {
|
|
|
148
165
|
"name": "openPersonWindow",
|
|
149
166
|
"signature": "@Remote async openPersonWindow(url?: string, signal?: AbortSignal): Promise<void>"
|
|
150
167
|
},
|
|
168
|
+
{
|
|
169
|
+
"kind": "method",
|
|
170
|
+
"name": "startBrowser",
|
|
171
|
+
"signature": "@Remote async startBrowser(signal: AbortSignal): Promise<void>",
|
|
172
|
+
"summary": "The person pressed retry.",
|
|
173
|
+
"jsDoc": "/** The person pressed retry. A browser that exited starts again before the list is read. */"
|
|
174
|
+
},
|
|
151
175
|
{
|
|
152
176
|
"kind": "method",
|
|
153
177
|
"name": "prepareStep",
|
|
@@ -10,11 +10,13 @@ declare module '@deepseek-ai/dsh-typert-protocol' {
|
|
|
10
10
|
interface TypertRemoteNamespace$6d68576f726b7370616365 {
|
|
11
11
|
ensureWorkspace: (projectUrl: string, signal?: AbortSignal) => Promise<RemoteResult<{ workspaceId: string; }>>
|
|
12
12
|
openPersonWindow: (url?: string, signal?: AbortSignal) => Promise<RemoteResult<void>>
|
|
13
|
+
startBrowser: (signal?: AbortSignal) => Promise<RemoteResult<void>>
|
|
13
14
|
syncProjects: (signal?: AbortSignal) => Promise<RemoteResult<ProjectsView>>
|
|
14
15
|
}
|
|
15
16
|
interface TypertRemoteMap {
|
|
16
17
|
'mhWorkspace/ensureWorkspace': (projectUrl: string, signal?: AbortSignal) => Promise<RemoteResult<{ workspaceId: string; }>>
|
|
17
18
|
'mhWorkspace/openPersonWindow': (url?: string, signal?: AbortSignal) => Promise<RemoteResult<void>>
|
|
19
|
+
'mhWorkspace/startBrowser': (signal?: AbortSignal) => Promise<RemoteResult<void>>
|
|
18
20
|
'mhWorkspace/syncProjects': (signal?: AbortSignal) => Promise<RemoteResult<ProjectsView>>
|
|
19
21
|
}
|
|
20
22
|
interface TypertRemoteNamespaceMap {
|
|
@@ -25,6 +27,7 @@ declare module '@deepseek-ai/dsh-typert-protocol' {
|
|
|
25
27
|
export declare const TYPERT_REMOTE: TypertRemoteInfo<{
|
|
26
28
|
readonly 'mhWorkspace/ensureWorkspace': TypertRemoteMethod<{ readonly 'projectUrl': string }, { workspaceId: string; }>
|
|
27
29
|
readonly 'mhWorkspace/openPersonWindow': TypertRemoteMethod<{ readonly 'url'?: string }, void>
|
|
30
|
+
readonly 'mhWorkspace/startBrowser': TypertRemoteMethod<{ }, void>
|
|
28
31
|
readonly 'mhWorkspace/syncProjects': TypertRemoteMethod<{ }, ProjectsView>
|
|
29
32
|
}>
|
|
30
33
|
export default TYPERT_REMOTE
|
|
@@ -13,6 +13,8 @@ let _mind_harness_mh_workspace_mhWorkspace_openPersonWindow_parameter_0$schema$v
|
|
|
13
13
|
const _mind_harness_mh_workspace_mhWorkspace_openPersonWindow_parameter_0$schema = () => (_mind_harness_mh_workspace_mhWorkspace_openPersonWindow_parameter_0$schema$value ??= z.union([z.undefined(), z.string()]))
|
|
14
14
|
let _mind_harness_mh_workspace_mhWorkspace_openPersonWindow_result$schema$value
|
|
15
15
|
const _mind_harness_mh_workspace_mhWorkspace_openPersonWindow_result$schema = () => (_mind_harness_mh_workspace_mhWorkspace_openPersonWindow_result$schema$value ??= z.void())
|
|
16
|
+
let _mind_harness_mh_workspace_mhWorkspace_startBrowser_result$schema$value
|
|
17
|
+
const _mind_harness_mh_workspace_mhWorkspace_startBrowser_result$schema = () => (_mind_harness_mh_workspace_mhWorkspace_startBrowser_result$schema$value ??= z.void())
|
|
16
18
|
let _mind_harness_mh_workspace_mhWorkspace_syncProjects_result$schema$value
|
|
17
19
|
const _mind_harness_mh_workspace_mhWorkspace_syncProjects_result$schema = () => (_mind_harness_mh_workspace_mhWorkspace_syncProjects_result$schema$value ??= z.object({
|
|
18
20
|
'projects': z.array(z.object({
|
|
@@ -62,7 +64,7 @@ export const TYPERT_REMOTE = createTypertRemoteInfo({
|
|
|
62
64
|
create: _mind_harness_mh_workspace_mhWorkspace_ensureWorkspace_result$schema,
|
|
63
65
|
jsonSchema: {"type":"object","properties":{"workspaceId":{"type":"string"}},"required":["workspaceId"],"additionalProperties":true},
|
|
64
66
|
},
|
|
65
|
-
sourceLocation: {"file":"packages/mh-workspace/src/service.ts","line":
|
|
67
|
+
sourceLocation: {"file":"packages/mh-workspace/src/service.ts","line":178,"column":9},
|
|
66
68
|
},
|
|
67
69
|
'mhWorkspace/openPersonWindow': {
|
|
68
70
|
service: 'mhWorkspace',
|
|
@@ -93,7 +95,22 @@ export const TYPERT_REMOTE = createTypertRemoteInfo({
|
|
|
93
95
|
create: _mind_harness_mh_workspace_mhWorkspace_openPersonWindow_result$schema,
|
|
94
96
|
jsonSchemaError: 'typert tool schema: unsupported void value',
|
|
95
97
|
},
|
|
96
|
-
sourceLocation: {"file":"packages/mh-workspace/src/service.ts","line":
|
|
98
|
+
sourceLocation: {"file":"packages/mh-workspace/src/service.ts","line":187,"column":9},
|
|
99
|
+
},
|
|
100
|
+
'mhWorkspace/startBrowser': {
|
|
101
|
+
service: 'mhWorkspace',
|
|
102
|
+
description: 'The person pressed retry. A browser that exited starts again before the list is read.',
|
|
103
|
+
invocation: { kind: 'direct' },
|
|
104
|
+
parameters: [
|
|
105
|
+
],
|
|
106
|
+
cancellation: { parameter: 'signal' },
|
|
107
|
+
result: {
|
|
108
|
+
mode: 'strict',
|
|
109
|
+
typeSymbol: '@mind-harness/mh-workspace#mhWorkspace/startBrowser:result',
|
|
110
|
+
create: _mind_harness_mh_workspace_mhWorkspace_startBrowser_result$schema,
|
|
111
|
+
jsonSchemaError: 'typert tool schema: unsupported void value',
|
|
112
|
+
},
|
|
113
|
+
sourceLocation: {"file":"packages/mh-workspace/src/service.ts","line":211,"column":9},
|
|
97
114
|
},
|
|
98
115
|
'mhWorkspace/syncProjects': {
|
|
99
116
|
service: 'mhWorkspace',
|
|
@@ -108,7 +125,7 @@ export const TYPERT_REMOTE = createTypertRemoteInfo({
|
|
|
108
125
|
create: _mind_harness_mh_workspace_mhWorkspace_syncProjects_result$schema,
|
|
109
126
|
jsonSchema: {"type":"object","properties":{"projects":{"type":"array","items":{"type":"object","properties":{"url":{"type":"string"},"name":{"type":"string"},"projectId":{"type":"string"},"workspaceId":{"type":"string"},"removed":{"type":"boolean","const":true,"description":"The person removed this Project's Workspace. It is not in the sidebar."}},"required":["url","name","projectId"],"additionalProperties":true}},"signedIn":{"type":"boolean","description":"The Memory home names a viewer. Signed out, the list holds only what is public."},"selfLogin":{"type":"boolean"}},"required":["projects","signedIn","selfLogin"],"additionalProperties":true},
|
|
110
127
|
},
|
|
111
|
-
sourceLocation: {"file":"packages/mh-workspace/src/service.ts","line":
|
|
128
|
+
sourceLocation: {"file":"packages/mh-workspace/src/service.ts","line":164,"column":9},
|
|
112
129
|
},
|
|
113
130
|
},
|
|
114
131
|
}, z)
|
package/lib/types/service.d.ts
CHANGED
|
@@ -53,6 +53,8 @@ export declare class MhWorkspaceService extends TypertRemoteService {
|
|
|
53
53
|
workspaceId: string;
|
|
54
54
|
}>;
|
|
55
55
|
openPersonWindow(url?: string, signal?: AbortSignal): Promise<void>;
|
|
56
|
+
/** The person pressed retry. A browser that exited starts again before the list is read. */
|
|
57
|
+
startBrowser(signal: AbortSignal): Promise<void>;
|
|
56
58
|
/**
|
|
57
59
|
* Keep the Session's Project context current and, on the first step of its
|
|
58
60
|
* first turn, place the cwd pages. Later steps read Memory only while a
|
package/locale/en.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"meta": {
|
|
3
3
|
"title": "Mind Harness projects",
|
|
4
|
-
"description": "Lists your
|
|
4
|
+
"description": "Lists your Mind Harness Projects and gives each one a workspace; a Session started there begins with the Project page and what its README cites."
|
|
5
5
|
}
|
|
6
6
|
}
|
package/locale/zh.json
CHANGED
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mind-harness/mh-workspace",
|
|
3
|
-
"version": "0.1.
|
|
4
|
-
"description": "Lists your
|
|
3
|
+
"version": "0.1.6",
|
|
4
|
+
"description": "Lists your Mind Harness Projects and gives each one a workspace; a Session started there begins with the Project's README and AGENTS.md.",
|
|
5
5
|
"license": "SEE LICENSE IN LICENSE",
|
|
6
6
|
"files": [
|
|
7
7
|
"lib/index.js",
|
|
@@ -42,7 +42,7 @@
|
|
|
42
42
|
"access": "public"
|
|
43
43
|
},
|
|
44
44
|
"dependencies": {
|
|
45
|
-
"@mind-harness/mh-browser": "0.1.
|
|
45
|
+
"@mind-harness/mh-browser": "0.1.6",
|
|
46
46
|
"zod": "^4.6.6"
|
|
47
47
|
},
|
|
48
48
|
"devDependencies": {
|