@mind-harness/mh-workspace 0.1.1 → 0.1.3
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/index.js +19 -2
- package/lib/typert.host.js +3 -3
- package/lib/typert.remote-client.js +3 -3
- package/lib/types/service.d.ts +3 -0
- package/package.json +11 -11
package/lib/index.js
CHANGED
|
@@ -314,6 +314,7 @@ let MhWorkspaceService = (() => {
|
|
|
314
314
|
constructor(ctx, config) {
|
|
315
315
|
super(ctx, "mhWorkspace");
|
|
316
316
|
this.home = config.memory.home;
|
|
317
|
+
this.noteHome(this.home.get());
|
|
317
318
|
this.projectsDir = projectsDirOf(config);
|
|
318
319
|
this.ready = this.mount();
|
|
319
320
|
Object.getPrototypeOf(ctx).on("loader/volatile-update", () => {
|
|
@@ -328,7 +329,7 @@ let MhWorkspaceService = (() => {
|
|
|
328
329
|
text: (context) => {
|
|
329
330
|
const session = context.agent?.session;
|
|
330
331
|
const project = session === void 0 ? void 0 : this.contexts.get(session.id);
|
|
331
|
-
return project === void 0 || project === null ? "" : projectContextText(project, this.
|
|
332
|
+
return project === void 0 || project === null ? "" : projectContextText(project, this.readHome());
|
|
332
333
|
}
|
|
333
334
|
});
|
|
334
335
|
const listen = ctx.on;
|
|
@@ -666,10 +667,26 @@ let MhWorkspaceService = (() => {
|
|
|
666
667
|
}
|
|
667
668
|
/** The configured home. Not http(s) fails closed, before any request. */
|
|
668
669
|
memoryHome() {
|
|
669
|
-
const home = this.
|
|
670
|
+
const home = this.readHome();
|
|
670
671
|
if (!isWebUrl(home)) throw unreadable("address is not http or https");
|
|
671
672
|
return home;
|
|
672
673
|
}
|
|
674
|
+
/** Read `memory.home` and, when it is http(s), tell the browser its origin. */
|
|
675
|
+
readHome() {
|
|
676
|
+
const home = this.home.get();
|
|
677
|
+
this.noteHome(home);
|
|
678
|
+
return home;
|
|
679
|
+
}
|
|
680
|
+
noteHome(home) {
|
|
681
|
+
if (!isWebUrl(home)) return;
|
|
682
|
+
let origin;
|
|
683
|
+
try {
|
|
684
|
+
origin = new URL(home).origin;
|
|
685
|
+
} catch {
|
|
686
|
+
return;
|
|
687
|
+
}
|
|
688
|
+
this.browser().declareAgentViewOrigin(origin);
|
|
689
|
+
}
|
|
673
690
|
async readJson(url, signal) {
|
|
674
691
|
if (signal.aborted) throw cancelled();
|
|
675
692
|
let response;
|
package/lib/typert.host.js
CHANGED
|
@@ -62,7 +62,7 @@ const $remote = createTypertRemoteInfo({
|
|
|
62
62
|
create: _mind_harness_mh_workspace_mhWorkspace_ensureWorkspace_result$schema,
|
|
63
63
|
jsonSchema: {"type":"object","properties":{"workspaceId":{"type":"string"}},"required":["workspaceId"],"additionalProperties":true},
|
|
64
64
|
},
|
|
65
|
-
sourceLocation: {"file":"packages/mh-workspace/src/service.ts","line":
|
|
65
|
+
sourceLocation: {"file":"packages/mh-workspace/src/service.ts","line":177,"column":9},
|
|
66
66
|
},
|
|
67
67
|
'mhWorkspace/openPersonWindow': {
|
|
68
68
|
service: 'mhWorkspace',
|
|
@@ -93,7 +93,7 @@ const $remote = createTypertRemoteInfo({
|
|
|
93
93
|
create: _mind_harness_mh_workspace_mhWorkspace_openPersonWindow_result$schema,
|
|
94
94
|
jsonSchemaError: 'typert tool schema: unsupported void value',
|
|
95
95
|
},
|
|
96
|
-
sourceLocation: {"file":"packages/mh-workspace/src/service.ts","line":
|
|
96
|
+
sourceLocation: {"file":"packages/mh-workspace/src/service.ts","line":186,"column":9},
|
|
97
97
|
},
|
|
98
98
|
'mhWorkspace/syncProjects': {
|
|
99
99
|
service: 'mhWorkspace',
|
|
@@ -108,7 +108,7 @@ const $remote = createTypertRemoteInfo({
|
|
|
108
108
|
create: _mind_harness_mh_workspace_mhWorkspace_syncProjects_result$schema,
|
|
109
109
|
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
110
|
},
|
|
111
|
-
sourceLocation: {"file":"packages/mh-workspace/src/service.ts","line":
|
|
111
|
+
sourceLocation: {"file":"packages/mh-workspace/src/service.ts","line":163,"column":9},
|
|
112
112
|
},
|
|
113
113
|
},
|
|
114
114
|
}, z)
|
|
@@ -62,7 +62,7 @@ export const TYPERT_REMOTE = createTypertRemoteInfo({
|
|
|
62
62
|
create: _mind_harness_mh_workspace_mhWorkspace_ensureWorkspace_result$schema,
|
|
63
63
|
jsonSchema: {"type":"object","properties":{"workspaceId":{"type":"string"}},"required":["workspaceId"],"additionalProperties":true},
|
|
64
64
|
},
|
|
65
|
-
sourceLocation: {"file":"packages/mh-workspace/src/service.ts","line":
|
|
65
|
+
sourceLocation: {"file":"packages/mh-workspace/src/service.ts","line":177,"column":9},
|
|
66
66
|
},
|
|
67
67
|
'mhWorkspace/openPersonWindow': {
|
|
68
68
|
service: 'mhWorkspace',
|
|
@@ -93,7 +93,7 @@ export const TYPERT_REMOTE = createTypertRemoteInfo({
|
|
|
93
93
|
create: _mind_harness_mh_workspace_mhWorkspace_openPersonWindow_result$schema,
|
|
94
94
|
jsonSchemaError: 'typert tool schema: unsupported void value',
|
|
95
95
|
},
|
|
96
|
-
sourceLocation: {"file":"packages/mh-workspace/src/service.ts","line":
|
|
96
|
+
sourceLocation: {"file":"packages/mh-workspace/src/service.ts","line":186,"column":9},
|
|
97
97
|
},
|
|
98
98
|
'mhWorkspace/syncProjects': {
|
|
99
99
|
service: 'mhWorkspace',
|
|
@@ -108,7 +108,7 @@ export const TYPERT_REMOTE = createTypertRemoteInfo({
|
|
|
108
108
|
create: _mind_harness_mh_workspace_mhWorkspace_syncProjects_result$schema,
|
|
109
109
|
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
110
|
},
|
|
111
|
-
sourceLocation: {"file":"packages/mh-workspace/src/service.ts","line":
|
|
111
|
+
sourceLocation: {"file":"packages/mh-workspace/src/service.ts","line":163,"column":9},
|
|
112
112
|
},
|
|
113
113
|
},
|
|
114
114
|
}, z)
|
package/lib/types/service.d.ts
CHANGED
|
@@ -99,6 +99,9 @@ export declare class MhWorkspaceService extends TypertRemoteService {
|
|
|
99
99
|
private recordForPath;
|
|
100
100
|
/** The configured home. Not http(s) fails closed, before any request. */
|
|
101
101
|
private memoryHome;
|
|
102
|
+
/** Read `memory.home` and, when it is http(s), tell the browser its origin. */
|
|
103
|
+
private readHome;
|
|
104
|
+
private noteHome;
|
|
102
105
|
private readJson;
|
|
103
106
|
}
|
|
104
107
|
/** Directory segment for one Memory: its host, with `:` written as `_`. */
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mind-harness/mh-workspace",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.3",
|
|
4
4
|
"description": "Lists your Memory 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": [
|
|
@@ -42,18 +42,18 @@
|
|
|
42
42
|
"access": "public"
|
|
43
43
|
},
|
|
44
44
|
"dependencies": {
|
|
45
|
-
"
|
|
46
|
-
"
|
|
45
|
+
"@mind-harness/mh-browser": "0.1.3",
|
|
46
|
+
"zod": "^4.6.6"
|
|
47
47
|
},
|
|
48
48
|
"devDependencies": {
|
|
49
|
-
"@deepseek-ai/cordis": "4.0.5",
|
|
50
|
-
"@deepseek-ai/dsh-agent": "0.2.1-rc.3",
|
|
51
|
-
"@deepseek-ai/dsh-home-paths": "0.2.1-rc.3",
|
|
52
|
-
"@deepseek-ai/dsh-llm": "0.2.1-rc.3",
|
|
53
|
-
"@deepseek-ai/dsh-storage-domain": "0.2.1-rc.3",
|
|
54
|
-
"@deepseek-ai/dsh-typert-generator": "0.2.1-rc.3",
|
|
55
|
-
"@deepseek-ai/dsh-typert-protocol": "0.2.1-rc.3",
|
|
56
|
-
"@deepseek-ai/schemastery": "3.18.5"
|
|
49
|
+
"@deepseek-ai/cordis": "~4.0.5",
|
|
50
|
+
"@deepseek-ai/dsh-agent": "^0.2.1-rc.3",
|
|
51
|
+
"@deepseek-ai/dsh-home-paths": "^0.2.1-rc.3",
|
|
52
|
+
"@deepseek-ai/dsh-llm": "^0.2.1-rc.3",
|
|
53
|
+
"@deepseek-ai/dsh-storage-domain": "^0.2.1-rc.3",
|
|
54
|
+
"@deepseek-ai/dsh-typert-generator": "^0.2.1-rc.3",
|
|
55
|
+
"@deepseek-ai/dsh-typert-protocol": "^0.2.1-rc.3",
|
|
56
|
+
"@deepseek-ai/schemastery": "~3.18.5"
|
|
57
57
|
},
|
|
58
58
|
"peerDependencies": {
|
|
59
59
|
"@deepseek-ai/cordis": "~4.0.5",
|