@mind-harness/mh-workspace 0.0.0-stage → 0.1.0

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.
@@ -0,0 +1,3 @@
1
+ /* Generated by @deepseek-ai/dsh-typert-generator from FaceModel — do not edit. */
2
+
3
+ export declare const TYPERT: unknown
@@ -0,0 +1,191 @@
1
+ /* Generated by @deepseek-ai/dsh-typert-generator from FaceModel — do not edit. */
2
+ import { z } from 'zod'
3
+
4
+ import { createTypertRemoteInfo } from '@deepseek-ai/dsh-typert-protocol/remote-info'
5
+
6
+ let _mind_harness_mh_workspace_mhWorkspace_ensureWorkspace_parameter_0$schema$value
7
+ const _mind_harness_mh_workspace_mhWorkspace_ensureWorkspace_parameter_0$schema = () => (_mind_harness_mh_workspace_mhWorkspace_ensureWorkspace_parameter_0$schema$value ??= z.string())
8
+ let _mind_harness_mh_workspace_mhWorkspace_ensureWorkspace_result$schema$value
9
+ const _mind_harness_mh_workspace_mhWorkspace_ensureWorkspace_result$schema = () => (_mind_harness_mh_workspace_mhWorkspace_ensureWorkspace_result$schema$value ??= z.object({
10
+ 'workspaceId': z.string(),
11
+ }))
12
+ let _mind_harness_mh_workspace_mhWorkspace_openPersonWindow_parameter_0$schema$value
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
+ let _mind_harness_mh_workspace_mhWorkspace_openPersonWindow_result$schema$value
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_syncProjects_result$schema$value
17
+ const _mind_harness_mh_workspace_mhWorkspace_syncProjects_result$schema = () => (_mind_harness_mh_workspace_mhWorkspace_syncProjects_result$schema$value ??= z.object({
18
+ 'projects': z.array(z.object({
19
+ 'url': z.string(),
20
+ 'name': z.string(),
21
+ 'projectId': z.string(),
22
+ 'workspaceId': z.union([z.undefined(), z.string()]).optional(),
23
+ 'removed': z.union([z.undefined(), z.literal(true)]).optional().describe('The person removed this Project\'s Workspace. It is not in the sidebar.'),
24
+ })),
25
+ 'signedIn': z.boolean().describe('The Memory home names a viewer. Signed out, the list holds only what is public.'),
26
+ 'selfLogin': z.boolean(),
27
+ }))
28
+ let _mind_harness_mh_workspace_mhWorkspace_ensureWorkspace_parameter_0_strict$schema$value
29
+ const _mind_harness_mh_workspace_mhWorkspace_ensureWorkspace_parameter_0_strict$schema = () => (_mind_harness_mh_workspace_mhWorkspace_ensureWorkspace_parameter_0_strict$schema$value ??= z.string())
30
+ let _mind_harness_mh_workspace_mhWorkspace_openPersonWindow_parameter_0_strict$schema$value
31
+ const _mind_harness_mh_workspace_mhWorkspace_openPersonWindow_parameter_0_strict$schema = () => (_mind_harness_mh_workspace_mhWorkspace_openPersonWindow_parameter_0_strict$schema$value ??= z.union([z.undefined(), z.string()]))
32
+
33
+ const $remote = createTypertRemoteInfo({
34
+ package: '@mind-harness/mh-workspace',
35
+ methods: {
36
+ 'mhWorkspace/ensureWorkspace': {
37
+ service: 'mhWorkspace',
38
+ description: 'Put a listed Project back in the sidebar after the person removed it.',
39
+ invocation: { kind: 'direct' },
40
+ parameters: [
41
+ {
42
+ name: 'projectUrl',
43
+ source: 'json',
44
+ codec: {
45
+ mode: 'strict',
46
+ typeSymbol: '@mind-harness/mh-workspace#mhWorkspace/ensureWorkspace:projectUrl',
47
+ create: _mind_harness_mh_workspace_mhWorkspace_ensureWorkspace_parameter_0$schema,
48
+ jsonSchema: {"type":"string"},
49
+ },
50
+ strictCodec: {
51
+ mode: 'strict',
52
+ typeSymbol: '@mind-harness/mh-workspace#mhWorkspace/ensureWorkspace:projectUrl',
53
+ create: _mind_harness_mh_workspace_mhWorkspace_ensureWorkspace_parameter_0_strict$schema,
54
+ jsonSchema: {"type":"string"},
55
+ },
56
+ },
57
+ ],
58
+ cancellation: { parameter: 'signal' },
59
+ result: {
60
+ mode: 'strict',
61
+ typeSymbol: '@mind-harness/mh-workspace#mhWorkspace/ensureWorkspace:result',
62
+ create: _mind_harness_mh_workspace_mhWorkspace_ensureWorkspace_result$schema,
63
+ jsonSchema: {"type":"object","properties":{"workspaceId":{"type":"string"}},"required":["workspaceId"],"additionalProperties":true},
64
+ },
65
+ sourceLocation: {"file":"packages/mh-workspace/src/service.ts","line":175,"column":9},
66
+ },
67
+ 'mhWorkspace/openPersonWindow': {
68
+ service: 'mhWorkspace',
69
+ invocation: { kind: 'direct' },
70
+ parameters: [
71
+ {
72
+ name: 'url',
73
+ source: 'json',
74
+ acceptsUndefined: true,
75
+ codec: {
76
+ mode: 'strict',
77
+ typeSymbol: '@mind-harness/mh-workspace#mhWorkspace/openPersonWindow:url',
78
+ create: _mind_harness_mh_workspace_mhWorkspace_openPersonWindow_parameter_0$schema,
79
+ jsonSchema: {"type":"string"},
80
+ },
81
+ strictCodec: {
82
+ mode: 'strict',
83
+ typeSymbol: '@mind-harness/mh-workspace#mhWorkspace/openPersonWindow:url',
84
+ create: _mind_harness_mh_workspace_mhWorkspace_openPersonWindow_parameter_0_strict$schema,
85
+ jsonSchema: {"type":"string"},
86
+ },
87
+ },
88
+ ],
89
+ cancellation: { parameter: 'signal' },
90
+ result: {
91
+ mode: 'strict',
92
+ typeSymbol: '@mind-harness/mh-workspace#mhWorkspace/openPersonWindow:result',
93
+ create: _mind_harness_mh_workspace_mhWorkspace_openPersonWindow_result$schema,
94
+ jsonSchemaError: 'typert tool schema: unsupported void value',
95
+ },
96
+ sourceLocation: {"file":"packages/mh-workspace/src/service.ts","line":184,"column":9},
97
+ },
98
+ 'mhWorkspace/syncProjects': {
99
+ service: 'mhWorkspace',
100
+ description: 'List every reachable Project and register a Workspace for each one that the person has not removed. New Workspaces are registered from the end of the list, so the first Project ends up first: the registry prepends.',
101
+ invocation: { kind: 'direct' },
102
+ parameters: [
103
+ ],
104
+ cancellation: { parameter: 'signal' },
105
+ result: {
106
+ mode: 'strict',
107
+ typeSymbol: '@mind-harness/mh-workspace/views#ProjectsView',
108
+ create: _mind_harness_mh_workspace_mhWorkspace_syncProjects_result$schema,
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
+ },
111
+ sourceLocation: {"file":"packages/mh-workspace/src/service.ts","line":161,"column":9},
112
+ },
113
+ },
114
+ }, z)
115
+
116
+ export const TYPERT = {
117
+ package: '@mind-harness/mh-workspace',
118
+ face: 'host',
119
+ schemas: [
120
+ ],
121
+ get invocations() { return $remote.descriptors },
122
+ model: {
123
+ "services": [
124
+ {
125
+ "description": "Host half. Lists Memory projects through the browser request channel, registers one Workspace directory per project, and places the cwd pages on the first step.",
126
+ "summary": "Host half.",
127
+ "tags": [],
128
+ "jsDoc": "/**\n * Host half. Lists Memory projects through the browser request channel,\n * registers one Workspace directory per project, and places the cwd pages\n * on the first step.\n */",
129
+ "key": "mhWorkspace",
130
+ "exportName": "MhWorkspaceService",
131
+ "members": [
132
+ {
133
+ "kind": "method",
134
+ "name": "syncProjects",
135
+ "signature": "@Remote async syncProjects(signal: AbortSignal): Promise<ProjectsView>",
136
+ "summary": "List every reachable Project and register a Workspace for each one that the person has not removed.",
137
+ "jsDoc": "/**\n * List every reachable Project and register a Workspace for each one that\n * the person has not removed. New Workspaces are registered from the end of\n * the list, so the first Project ends up first: the registry prepends.\n */"
138
+ },
139
+ {
140
+ "kind": "method",
141
+ "name": "ensureWorkspace",
142
+ "signature": "@Remote async ensureWorkspace(projectUrl: string, signal: AbortSignal): Promise<{ workspaceId: string }>",
143
+ "summary": "Put a listed Project back in the sidebar after the person removed it.",
144
+ "jsDoc": "/** Put a listed Project back in the sidebar after the person removed it. */"
145
+ },
146
+ {
147
+ "kind": "method",
148
+ "name": "openPersonWindow",
149
+ "signature": "@Remote async openPersonWindow(url?: string, signal?: AbortSignal): Promise<void>"
150
+ },
151
+ {
152
+ "kind": "method",
153
+ "name": "prepareStep",
154
+ "signature": "async prepareStep(payload: StepPayload): Promise<void>",
155
+ "summary": "Keep the Session's Project context current and, on the first step of its first turn, place the cwd pages.",
156
+ "jsDoc": "/**\n * Keep the Session's Project context current and, on the first step of its\n * first turn, place the cwd pages. Later steps read Memory only while a\n * sign-in gap is open, to notice when it closes.\n */"
157
+ }
158
+ ],
159
+ "types": [
160
+ {
161
+ "name": "ProjectsView",
162
+ "declaration": "export interface ProjectsView {\n projects: ProjectView[];\n signedIn: boolean;\n selfLogin: boolean;\n}"
163
+ },
164
+ {
165
+ "name": "ProjectView",
166
+ "declaration": "export interface ProjectView {\n url: string;\n name: string;\n projectId: string;\n workspaceId?: string;\n removed?: true;\n}"
167
+ },
168
+ {
169
+ "name": "StepPayload",
170
+ "declaration": "export interface StepPayload {\n agent: { session: StepSession; };\n messages: readonly unknown[];\n step: number;\n signal: AbortSignal;\n}"
171
+ },
172
+ {
173
+ "name": "StepSession",
174
+ "declaration": "export interface StepSession {\n id: string;\n header: { cwd?: string; };\n}"
175
+ }
176
+ ]
177
+ }
178
+ ],
179
+ "events": [
180
+ {
181
+ "description": "Volatile config was committed on this plugin fiber. Paths are key arrays.",
182
+ "summary": "Volatile config was committed on this plugin fiber.",
183
+ "tags": [],
184
+ "jsDoc": "/** Volatile config was committed on this plugin fiber. Paths are key arrays. */",
185
+ "name": "loader/volatile-update",
186
+ "signature": "'loader/volatile-update'(paths: readonly (readonly string[])[]): void"
187
+ }
188
+ ],
189
+ "objects": []
190
+ },
191
+ }
@@ -0,0 +1,31 @@
1
+ /* Generated by @deepseek-ai/dsh-typert-generator from the Host FaceModel — do not edit. */
2
+ import type {
3
+ RemoteResult,
4
+ TypertRemoteInfo,
5
+ TypertRemoteMethod,
6
+ } from '@deepseek-ai/dsh-typert-protocol'
7
+ import type { ProjectsView } from '@mind-harness/mh-workspace/views'
8
+
9
+ declare module '@deepseek-ai/dsh-typert-protocol' {
10
+ interface TypertRemoteNamespace$6d68576f726b7370616365 {
11
+ ensureWorkspace: (projectUrl: string, signal?: AbortSignal) => Promise<RemoteResult<{ workspaceId: string; }>>
12
+ openPersonWindow: (url?: string, signal?: AbortSignal) => Promise<RemoteResult<void>>
13
+ syncProjects: (signal?: AbortSignal) => Promise<RemoteResult<ProjectsView>>
14
+ }
15
+ interface TypertRemoteMap {
16
+ 'mhWorkspace/ensureWorkspace': (projectUrl: string, signal?: AbortSignal) => Promise<RemoteResult<{ workspaceId: string; }>>
17
+ 'mhWorkspace/openPersonWindow': (url?: string, signal?: AbortSignal) => Promise<RemoteResult<void>>
18
+ 'mhWorkspace/syncProjects': (signal?: AbortSignal) => Promise<RemoteResult<ProjectsView>>
19
+ }
20
+ interface TypertRemoteNamespaceMap {
21
+ 'mhWorkspace': TypertRemoteNamespace$6d68576f726b7370616365
22
+ }
23
+ }
24
+
25
+ export declare const TYPERT_REMOTE: TypertRemoteInfo<{
26
+ readonly 'mhWorkspace/ensureWorkspace': TypertRemoteMethod<{ readonly 'projectUrl': string }, { workspaceId: string; }>
27
+ readonly 'mhWorkspace/openPersonWindow': TypertRemoteMethod<{ readonly 'url'?: string }, void>
28
+ readonly 'mhWorkspace/syncProjects': TypertRemoteMethod<{ }, ProjectsView>
29
+ }>
30
+ export default TYPERT_REMOTE
31
+ //# sourceMappingURL=typert.remote-client.d.ts.map
@@ -0,0 +1,116 @@
1
+ /* Generated by @deepseek-ai/dsh-typert-generator from the Host FaceModel — do not edit. */
2
+ import { z } from 'zod'
3
+
4
+ import { createTypertRemoteInfo } from '@deepseek-ai/dsh-typert-protocol/remote-info'
5
+
6
+ let _mind_harness_mh_workspace_mhWorkspace_ensureWorkspace_parameter_0$schema$value
7
+ const _mind_harness_mh_workspace_mhWorkspace_ensureWorkspace_parameter_0$schema = () => (_mind_harness_mh_workspace_mhWorkspace_ensureWorkspace_parameter_0$schema$value ??= z.string())
8
+ let _mind_harness_mh_workspace_mhWorkspace_ensureWorkspace_result$schema$value
9
+ const _mind_harness_mh_workspace_mhWorkspace_ensureWorkspace_result$schema = () => (_mind_harness_mh_workspace_mhWorkspace_ensureWorkspace_result$schema$value ??= z.object({
10
+ 'workspaceId': z.string(),
11
+ }))
12
+ let _mind_harness_mh_workspace_mhWorkspace_openPersonWindow_parameter_0$schema$value
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
+ let _mind_harness_mh_workspace_mhWorkspace_openPersonWindow_result$schema$value
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_syncProjects_result$schema$value
17
+ const _mind_harness_mh_workspace_mhWorkspace_syncProjects_result$schema = () => (_mind_harness_mh_workspace_mhWorkspace_syncProjects_result$schema$value ??= z.object({
18
+ 'projects': z.array(z.object({
19
+ 'url': z.string(),
20
+ 'name': z.string(),
21
+ 'projectId': z.string(),
22
+ 'workspaceId': z.union([z.undefined(), z.string()]).optional(),
23
+ 'removed': z.union([z.undefined(), z.literal(true)]).optional().describe('The person removed this Project\'s Workspace. It is not in the sidebar.'),
24
+ })),
25
+ 'signedIn': z.boolean().describe('The Memory home names a viewer. Signed out, the list holds only what is public.'),
26
+ 'selfLogin': z.boolean(),
27
+ }))
28
+ let _mind_harness_mh_workspace_mhWorkspace_ensureWorkspace_parameter_0_strict$schema$value
29
+ const _mind_harness_mh_workspace_mhWorkspace_ensureWorkspace_parameter_0_strict$schema = () => (_mind_harness_mh_workspace_mhWorkspace_ensureWorkspace_parameter_0_strict$schema$value ??= z.string())
30
+ let _mind_harness_mh_workspace_mhWorkspace_openPersonWindow_parameter_0_strict$schema$value
31
+ const _mind_harness_mh_workspace_mhWorkspace_openPersonWindow_parameter_0_strict$schema = () => (_mind_harness_mh_workspace_mhWorkspace_openPersonWindow_parameter_0_strict$schema$value ??= z.union([z.undefined(), z.string()]))
32
+
33
+ export const TYPERT_REMOTE = createTypertRemoteInfo({
34
+ package: '@mind-harness/mh-workspace',
35
+ methods: {
36
+ 'mhWorkspace/ensureWorkspace': {
37
+ service: 'mhWorkspace',
38
+ description: 'Put a listed Project back in the sidebar after the person removed it.',
39
+ invocation: { kind: 'direct' },
40
+ parameters: [
41
+ {
42
+ name: 'projectUrl',
43
+ source: 'json',
44
+ codec: {
45
+ mode: 'strict',
46
+ typeSymbol: '@mind-harness/mh-workspace#mhWorkspace/ensureWorkspace:projectUrl',
47
+ create: _mind_harness_mh_workspace_mhWorkspace_ensureWorkspace_parameter_0$schema,
48
+ jsonSchema: {"type":"string"},
49
+ },
50
+ strictCodec: {
51
+ mode: 'strict',
52
+ typeSymbol: '@mind-harness/mh-workspace#mhWorkspace/ensureWorkspace:projectUrl',
53
+ create: _mind_harness_mh_workspace_mhWorkspace_ensureWorkspace_parameter_0_strict$schema,
54
+ jsonSchema: {"type":"string"},
55
+ },
56
+ },
57
+ ],
58
+ cancellation: { parameter: 'signal' },
59
+ result: {
60
+ mode: 'strict',
61
+ typeSymbol: '@mind-harness/mh-workspace#mhWorkspace/ensureWorkspace:result',
62
+ create: _mind_harness_mh_workspace_mhWorkspace_ensureWorkspace_result$schema,
63
+ jsonSchema: {"type":"object","properties":{"workspaceId":{"type":"string"}},"required":["workspaceId"],"additionalProperties":true},
64
+ },
65
+ sourceLocation: {"file":"packages/mh-workspace/src/service.ts","line":175,"column":9},
66
+ },
67
+ 'mhWorkspace/openPersonWindow': {
68
+ service: 'mhWorkspace',
69
+ invocation: { kind: 'direct' },
70
+ parameters: [
71
+ {
72
+ name: 'url',
73
+ source: 'json',
74
+ acceptsUndefined: true,
75
+ codec: {
76
+ mode: 'strict',
77
+ typeSymbol: '@mind-harness/mh-workspace#mhWorkspace/openPersonWindow:url',
78
+ create: _mind_harness_mh_workspace_mhWorkspace_openPersonWindow_parameter_0$schema,
79
+ jsonSchema: {"type":"string"},
80
+ },
81
+ strictCodec: {
82
+ mode: 'strict',
83
+ typeSymbol: '@mind-harness/mh-workspace#mhWorkspace/openPersonWindow:url',
84
+ create: _mind_harness_mh_workspace_mhWorkspace_openPersonWindow_parameter_0_strict$schema,
85
+ jsonSchema: {"type":"string"},
86
+ },
87
+ },
88
+ ],
89
+ cancellation: { parameter: 'signal' },
90
+ result: {
91
+ mode: 'strict',
92
+ typeSymbol: '@mind-harness/mh-workspace#mhWorkspace/openPersonWindow:result',
93
+ create: _mind_harness_mh_workspace_mhWorkspace_openPersonWindow_result$schema,
94
+ jsonSchemaError: 'typert tool schema: unsupported void value',
95
+ },
96
+ sourceLocation: {"file":"packages/mh-workspace/src/service.ts","line":184,"column":9},
97
+ },
98
+ 'mhWorkspace/syncProjects': {
99
+ service: 'mhWorkspace',
100
+ description: 'List every reachable Project and register a Workspace for each one that the person has not removed. New Workspaces are registered from the end of the list, so the first Project ends up first: the registry prepends.',
101
+ invocation: { kind: 'direct' },
102
+ parameters: [
103
+ ],
104
+ cancellation: { parameter: 'signal' },
105
+ result: {
106
+ mode: 'strict',
107
+ typeSymbol: '@mind-harness/mh-workspace/views#ProjectsView',
108
+ create: _mind_harness_mh_workspace_mhWorkspace_syncProjects_result$schema,
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
+ },
111
+ sourceLocation: {"file":"packages/mh-workspace/src/service.ts","line":161,"column":9},
112
+ },
113
+ },
114
+ }, z)
115
+
116
+ export default TYPERT_REMOTE
@@ -0,0 +1,11 @@
1
+ export interface CitedPage {
2
+ url: string;
3
+ representation?: {
4
+ kind: string;
5
+ text?: string;
6
+ };
7
+ }
8
+ /** Hrefs of one link relation, copied from Agent Views the browser just returned. */
9
+ export declare function linkedUrls(views: readonly CitedPage[], rel: string): string[];
10
+ export declare function sameUrl(left: string, right: string): boolean;
11
+ //# sourceMappingURL=cites.d.ts.map
@@ -0,0 +1,28 @@
1
+ import { RemoteError } from '@deepseek-ai/dsh-typert-protocol';
2
+ declare module '@deepseek-ai/dsh-typert-protocol' {
3
+ interface RemoteErrorDetailsMap {
4
+ /** Memory home answered 401. */
5
+ 'mh-workspace/unauthenticated': {
6
+ readonly title: string;
7
+ readonly status: number;
8
+ };
9
+ /** The response was not JSON, or the request failed. */
10
+ 'mh-workspace/unreadable': {
11
+ readonly reason: string;
12
+ readonly status?: number;
13
+ readonly finalUrl?: string;
14
+ };
15
+ /** The address was not in the last syncProjects result. */
16
+ 'mh-workspace/unlisted': {
17
+ readonly url: string;
18
+ };
19
+ }
20
+ }
21
+ export declare function unauthenticated(title: string, status: number): RemoteError;
22
+ export declare function unreadable(reason: string, extra?: {
23
+ status?: number;
24
+ finalUrl?: string;
25
+ }): RemoteError;
26
+ export declare function unlisted(url: string): RemoteError;
27
+ export declare function cancelled(): RemoteError;
28
+ //# sourceMappingURL=codes.d.ts.map
@@ -0,0 +1,22 @@
1
+ import z from '@deepseek-ai/schemastery';
2
+ export declare const DEFAULT_HOME = "https://mindharness.com/";
3
+ export declare const workspaceConfig: z<Schemastery.ObjectS<NoInfer<{
4
+ memory: z<Schemastery.ObjectS<NoInfer<{
5
+ home: z<string, string, "volatile-defined">;
6
+ }>>, Schemastery.ObjectT<NoInfer<{
7
+ home: z<string, string, "volatile-defined">;
8
+ }>>, "defined">;
9
+ projectsDir: z<string, string, "plain">;
10
+ }>>, Schemastery.ObjectT<NoInfer<{
11
+ memory: z<Schemastery.ObjectS<NoInfer<{
12
+ home: z<string, string, "volatile-defined">;
13
+ }>>, Schemastery.ObjectT<NoInfer<{
14
+ home: z<string, string, "volatile-defined">;
15
+ }>>, "defined">;
16
+ projectsDir: z<string, string, "plain">;
17
+ }>>, "plain">;
18
+ export type WorkspaceConfig = ReturnType<typeof workspaceConfig>;
19
+ export declare function projectsDirOf(config: {
20
+ projectsDir?: string;
21
+ }): string;
22
+ //# sourceMappingURL=config.d.ts.map
@@ -0,0 +1,13 @@
1
+ /** What one root-level page of a Project offers toward the cwd pages. */
2
+ export interface RootLevel {
3
+ readme?: string;
4
+ rules?: string;
5
+ next?: string;
6
+ }
7
+ /** One root-level page of a Project; undefined when it is not a readable Agent View. */
8
+ export declare function rootLevel(text: string, url: string): RootLevel | undefined;
9
+ /** The Project's own cwd pages, broad to specific: root README, then root AGENTS.md. */
10
+ export declare function projectPages(levels: readonly RootLevel[]): string[];
11
+ /** Placing order: what those pages require first, then the pages themselves. */
12
+ export declare function placingOrder(required: readonly string[], own: readonly string[]): string[];
13
+ //# sourceMappingURL=cwd-pages.d.ts.map
@@ -0,0 +1,18 @@
1
+ import { z } from 'zod';
2
+ import { type DomainSpec } from '@deepseek-ai/dsh-storage-domain';
3
+ export declare const projectRecord: z.ZodObject<{
4
+ projectId: z.ZodString;
5
+ url: z.ZodString;
6
+ workspaceId: z.ZodString;
7
+ path: z.ZodString;
8
+ title: z.ZodOptional<z.ZodString>;
9
+ removed: z.ZodOptional<z.ZodBoolean>;
10
+ }, z.core.$strip>;
11
+ export type ProjectRecord = z.infer<typeof projectRecord>;
12
+ export declare const mhWorkspaceDomain: DomainSpec;
13
+ export interface ProjectTable {
14
+ get(key: string): ProjectRecord | undefined;
15
+ entries(): Iterable<[string, ProjectRecord]>;
16
+ put(key: string, value: ProjectRecord): Promise<void>;
17
+ }
18
+ //# sourceMappingURL=domain.d.ts.map
@@ -0,0 +1,26 @@
1
+ import type { Context } from '@deepseek-ai/cordis';
2
+ import { type WorkspaceConfig } from './config.ts';
3
+ import { MhWorkspaceService } from './service.ts';
4
+ export declare const name = "mh-workspace";
5
+ export declare const inject: string[];
6
+ export type Config = WorkspaceConfig;
7
+ export declare const Config: import("@deepseek-ai/schemastery").default<Schemastery.ObjectS<NoInfer<{
8
+ memory: import("@deepseek-ai/schemastery").default<Schemastery.ObjectS<NoInfer<{
9
+ home: import("@deepseek-ai/schemastery").default<string, string, "volatile-defined">;
10
+ }>>, Schemastery.ObjectT<NoInfer<{
11
+ home: import("@deepseek-ai/schemastery").default<string, string, "volatile-defined">;
12
+ }>>, "defined">;
13
+ projectsDir: import("@deepseek-ai/schemastery").default<string, string, "plain">;
14
+ }>>, Schemastery.ObjectT<NoInfer<{
15
+ memory: import("@deepseek-ai/schemastery").default<Schemastery.ObjectS<NoInfer<{
16
+ home: import("@deepseek-ai/schemastery").default<string, string, "volatile-defined">;
17
+ }>>, Schemastery.ObjectT<NoInfer<{
18
+ home: import("@deepseek-ai/schemastery").default<string, string, "volatile-defined">;
19
+ }>>, "defined">;
20
+ projectsDir: import("@deepseek-ai/schemastery").default<string, string, "plain">;
21
+ }>>, "plain">;
22
+ export declare function apply(ctx: Context, config: Config): void;
23
+ export { MhWorkspaceService };
24
+ export type { ProjectView, ProjectsView } from './views.ts';
25
+ export { DEFAULT_HOME } from './config.ts';
26
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1,16 @@
1
+ export interface ListedProject {
2
+ url: string;
3
+ name: string;
4
+ projectId: string;
5
+ }
6
+ /** Href values for one rel. Array links use `rel`; an object uses the rel as a key. */
7
+ export declare function linkHrefs(page: unknown, rel: string): string[];
8
+ /** Project rows. The address is `items[].id`. `project_id` comes from `fields`. */
9
+ export declare function projectItems(page: unknown): ListedProject[];
10
+ /** Home viewer is present: the browser is signed in. Memory answers 200 either way. */
11
+ export declare function signedInOf(page: unknown): boolean;
12
+ /** Home viewer is present and `act` is absent or empty. */
13
+ export declare function selfLoginOf(page: unknown): boolean;
14
+ export declare function titleOf(page: unknown): string;
15
+ export declare function parseJson(bytes: Uint8Array): unknown;
16
+ //# sourceMappingURL=json.d.ts.map
@@ -0,0 +1,20 @@
1
+ /** The Project a Session's runtime context names, and what is known about reading it. */
2
+ export interface ProjectContext {
3
+ url: string;
4
+ name?: string;
5
+ /** Why Memory cannot show the Project to the browser now. */
6
+ gap?: string;
7
+ /** The Project page could not be read on the first step. */
8
+ unread?: boolean;
9
+ }
10
+ export declare function projectContextText(context: ProjectContext, home: string): string;
11
+ /** What the working directory of a Project's Workspace is. */
12
+ export declare function workingCopySentence(project: string): string;
13
+ /** The `agent/pre-step` decision, as much of it as this plugin reads. */
14
+ export type StepDecision = {
15
+ kind: 'reject';
16
+ } | {
17
+ kind: 'enter';
18
+ messages: unknown[];
19
+ };
20
+ //# sourceMappingURL=notice.d.ts.map
@@ -0,0 +1,11 @@
1
+ export interface CitedPage {
2
+ url: string;
3
+ representation?: {
4
+ kind: string;
5
+ text?: string;
6
+ };
7
+ }
8
+ /** What these Agent Views list in `requires`, in order, without repeats. */
9
+ export declare function requiredUrls(views: readonly CitedPage[]): string[];
10
+ export declare function sameUrl(left: string, right: string): boolean;
11
+ //# sourceMappingURL=required.d.ts.map
@@ -0,0 +1,106 @@
1
+ import type { Context } from '@deepseek-ai/cordis';
2
+ import { TypertRemoteService } from '@deepseek-ai/dsh-typert-protocol';
3
+ import type { ProjectsView } from './views.ts';
4
+ import { type WorkspaceConfig } from './config.ts';
5
+ export type { ProjectView, ProjectsView } from './views.ts';
6
+ declare module '@deepseek-ai/cordis' {
7
+ interface Context {
8
+ mhWorkspace: MhWorkspaceService;
9
+ }
10
+ interface Events {
11
+ /** Volatile config was committed on this plugin fiber. Paths are key arrays. */
12
+ 'loader/volatile-update'(paths: readonly (readonly string[])[]): void;
13
+ }
14
+ }
15
+ interface StepSession {
16
+ id: string;
17
+ header: {
18
+ cwd?: string;
19
+ };
20
+ }
21
+ interface StepPayload {
22
+ agent: {
23
+ session: StepSession;
24
+ };
25
+ messages: readonly unknown[];
26
+ step: number;
27
+ signal: AbortSignal;
28
+ }
29
+ /**
30
+ * Host half. Lists Memory projects through the browser request channel,
31
+ * registers one Workspace directory per project, and places the cwd pages
32
+ * on the first step.
33
+ */
34
+ export declare class MhWorkspaceService extends TypertRemoteService {
35
+ static inject: string[];
36
+ private readonly home;
37
+ private readonly projectsDir;
38
+ private readonly ready;
39
+ private table;
40
+ private listed;
41
+ /** One sync at a time. A second call waits on this instead of listing again. */
42
+ private syncing;
43
+ private readonly contexts;
44
+ constructor(ctx: Context, config: WorkspaceConfig);
45
+ /**
46
+ * List every reachable Project and register a Workspace for each one that
47
+ * the person has not removed. New Workspaces are registered from the end of
48
+ * the list, so the first Project ends up first: the registry prepends.
49
+ */
50
+ syncProjects(signal: AbortSignal): Promise<ProjectsView>;
51
+ /** Put a listed Project back in the sidebar after the person removed it. */
52
+ ensureWorkspace(projectUrl: string, signal: AbortSignal): Promise<{
53
+ workspaceId: string;
54
+ }>;
55
+ openPersonWindow(url?: string, signal?: AbortSignal): Promise<void>;
56
+ /**
57
+ * Keep the Session's Project context current and, on the first step of its
58
+ * first turn, place the cwd pages. Later steps read Memory only while a
59
+ * sign-in gap is open, to notice when it closes.
60
+ */
61
+ prepareStep(payload: StepPayload): Promise<void>;
62
+ /** The first step of the Session's first turn. Later turns do not place pages. */
63
+ private isFirstStep;
64
+ /**
65
+ * The Project this Session's cwd is a working copy of. Only the first step
66
+ * may ask Memory, to find a Project by directory name; a resumed or forked
67
+ * Session is matched from storage alone.
68
+ */
69
+ private contextFor;
70
+ private storedProject;
71
+ /**
72
+ * Place the cwd pages, broad to specific: what the Project page, the root
73
+ * README and AGENTS.md require (the Memory home), the README, then
74
+ * AGENTS.md. The Project page itself is not placed. False when the Project
75
+ * page could not be read.
76
+ */
77
+ private placePages;
78
+ /** Follow `next` from the first root level until a level names AGENTS.md or none is left. */
79
+ private laterLevels;
80
+ private readLevel;
81
+ /** Why the browser cannot read the person's Projects now; undefined when it can. */
82
+ private signInGap;
83
+ private openQuietly;
84
+ private turns;
85
+ private browser;
86
+ private mount;
87
+ private projects;
88
+ private byUrl;
89
+ private doSync;
90
+ /**
91
+ * Bring one listed Project in line with its Workspace. A failure here is
92
+ * the caller's to skip; the rest of the list still registers.
93
+ */
94
+ private reconcile;
95
+ /** Create or reuse the Workspace directory and remember it. Clears `removed`. */
96
+ private register;
97
+ private projectForCwd;
98
+ private readProjects;
99
+ private recordForPath;
100
+ /** The configured home. Not http(s) fails closed, before any request. */
101
+ private memoryHome;
102
+ private readJson;
103
+ }
104
+ /** Directory segment for one Memory: its host, with `:` written as `_`. */
105
+ export declare function hostDir(home: string): string;
106
+ //# sourceMappingURL=service.d.ts.map
@@ -0,0 +1,15 @@
1
+ export interface ProjectView {
2
+ url: string;
3
+ name: string;
4
+ projectId: string;
5
+ workspaceId?: string;
6
+ /** The person removed this Project's Workspace. It is not in the sidebar. */
7
+ removed?: true;
8
+ }
9
+ export interface ProjectsView {
10
+ projects: ProjectView[];
11
+ /** The Memory home names a viewer. Signed out, the list holds only what is public. */
12
+ signedIn: boolean;
13
+ selfLogin: boolean;
14
+ }
15
+ //# sourceMappingURL=views.d.ts.map
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=views.js.map