@woosau/dsh-custom-env 0.0.0-stage → 0.1.1

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,5 @@
1
+ /* Generated by @deepseek-ai/dsh-typert-generator from FaceModel — do not edit. */
2
+ export declare const TYPERT: {
3
+ readonly package: '@woosau/dsh-custom-env'
4
+ readonly face: 'host'
5
+ }
@@ -0,0 +1,295 @@
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 list$result$schema$value
7
+ const list$result$schema = () => (list$result$schema$value ??= z.object({
8
+ path: z.string().readonly(),
9
+ exists: z.boolean().readonly(),
10
+ entries: z.array(z.object({
11
+ id: z.string().readonly(),
12
+ name: z.string().readonly(),
13
+ value: z.string().readonly(),
14
+ kind: z.enum(['unchanged', 'modified', 'added']).readonly(),
15
+ previous: z.string().nullable().readonly(),
16
+ }).readonly()).readonly(),
17
+ }))
18
+
19
+ let cliStatus$result$schema$value
20
+ const cliStatus$result$schema = () => (cliStatus$result$schema$value ??= z.object({
21
+ platform: z.string().readonly(),
22
+ activePath: z.string().nullable().readonly(),
23
+ expectedPath: z.string().nullable().readonly(),
24
+ expectedDirectory: z.string().nullable().readonly(),
25
+ matches: z.boolean().readonly(),
26
+ canInstall: z.boolean().readonly(),
27
+ reason: z.string().nullable().readonly(),
28
+ }))
29
+
30
+ let upsert$parameter$0$schema$value
31
+ const upsert$parameter$0$schema = () => (upsert$parameter$0$schema$value ??= z.string())
32
+ let upsert$parameter$1$schema$value
33
+ const upsert$parameter$1$schema = () => (upsert$parameter$1$schema$value ??= z.string())
34
+ let upsert$parameter$2$schema$value
35
+ const upsert$parameter$2$schema = () => (upsert$parameter$2$schema$value ??= z.string())
36
+
37
+ let remove$parameter$0$schema$value
38
+ const remove$parameter$0$schema = () => (remove$parameter$0$schema$value ??= z.string())
39
+
40
+ let restore$parameter$0$schema$value
41
+ const restore$parameter$0$schema = () => (restore$parameter$0$schema$value ??= z.string())
42
+
43
+ const cliStatusJsonSchema = {
44
+ type: 'object',
45
+ properties: {
46
+ platform: { type: 'string' },
47
+ activePath: { type: ['string', 'null'] },
48
+ expectedPath: { type: ['string', 'null'] },
49
+ expectedDirectory: { type: ['string', 'null'] },
50
+ matches: { type: 'boolean' },
51
+ canInstall: { type: 'boolean' },
52
+ reason: { type: ['string', 'null'] },
53
+ },
54
+ required: ['platform', 'activePath', 'expectedPath', 'expectedDirectory', 'matches', 'canInstall', 'reason'],
55
+ additionalProperties: true,
56
+ }
57
+
58
+ const envSnapshotJsonSchema = {
59
+ type: 'object',
60
+ properties: {
61
+ path: { type: 'string' },
62
+ exists: { type: 'boolean' },
63
+ entries: {
64
+ type: 'array',
65
+ items: {
66
+ type: 'object',
67
+ properties: {
68
+ id: { type: 'string' },
69
+ name: { type: 'string' },
70
+ value: { type: 'string' },
71
+ kind: { type: 'string', enum: ['unchanged', 'modified', 'added'] },
72
+ previous: { type: ['string', 'null'] },
73
+ },
74
+ required: ['id', 'name', 'value', 'kind', 'previous'],
75
+ additionalProperties: true,
76
+ },
77
+ },
78
+ },
79
+ required: ['path', 'exists', 'entries'],
80
+ additionalProperties: true,
81
+ }
82
+
83
+ const $remote = createTypertRemoteInfo({
84
+ package: '@woosau/dsh-custom-env',
85
+ methods: {
86
+ 'customEnv/list': {
87
+ service: 'customEnv',
88
+ description: 'List current $DSH_HOME/.env entries with pending classification.',
89
+ invocation: { kind: 'direct' },
90
+ parameters: [],
91
+ result: {
92
+ mode: 'strict',
93
+ typeSymbol: '@woosau/dsh-custom-env/types#EnvSnapshot',
94
+ create: list$result$schema,
95
+ description: 'path, existence, and sorted entries.',
96
+ jsonSchema: envSnapshotJsonSchema,
97
+ },
98
+ sourceLocation: { file: 'src/index.ts', line: 1, column: 1 },
99
+ },
100
+ 'customEnv/upsert': {
101
+ service: 'customEnv',
102
+ description: 'Create or update one row. Empty id creates a new row; otherwise keeps that baseline id across renames.',
103
+ invocation: { kind: 'direct' },
104
+ parameters: [
105
+ {
106
+ name: 'id',
107
+ description: 'stable row id from list(), or empty string for a new row.',
108
+ source: 'json',
109
+ codec: {
110
+ mode: 'strict',
111
+ typeSymbol: 'string',
112
+ create: upsert$parameter$0$schema,
113
+ jsonSchema: { type: 'string' },
114
+ },
115
+ },
116
+ {
117
+ name: 'name',
118
+ description: 'writable variable name.',
119
+ source: 'json',
120
+ codec: {
121
+ mode: 'strict',
122
+ typeSymbol: 'string',
123
+ create: upsert$parameter$1$schema,
124
+ jsonSchema: { type: 'string' },
125
+ },
126
+ },
127
+ {
128
+ name: 'value',
129
+ description: 'non-empty value.',
130
+ source: 'json',
131
+ codec: {
132
+ mode: 'strict',
133
+ typeSymbol: 'string',
134
+ create: upsert$parameter$2$schema,
135
+ jsonSchema: { type: 'string' },
136
+ },
137
+ },
138
+ ],
139
+ result: {
140
+ mode: 'strict',
141
+ typeSymbol: '@woosau/dsh-custom-env/types#EnvSnapshot',
142
+ create: list$result$schema,
143
+ description: 'updated snapshot.',
144
+ jsonSchema: envSnapshotJsonSchema,
145
+ },
146
+ sourceLocation: { file: 'src/index.ts', line: 1, column: 1 },
147
+ },
148
+ 'customEnv/deleteEntry': {
149
+ service: 'customEnv',
150
+ description: 'Delete one entry from the file, Host, and OS user environment.',
151
+ invocation: { kind: 'direct' },
152
+ parameters: [
153
+ {
154
+ name: 'id',
155
+ description: 'stable row id from list().',
156
+ source: 'json',
157
+ codec: {
158
+ mode: 'strict',
159
+ typeSymbol: 'string',
160
+ create: remove$parameter$0$schema,
161
+ jsonSchema: { type: 'string' },
162
+ },
163
+ },
164
+ ],
165
+ result: {
166
+ mode: 'strict',
167
+ typeSymbol: '@woosau/dsh-custom-env/types#EnvSnapshot',
168
+ create: list$result$schema,
169
+ description: 'updated snapshot.',
170
+ jsonSchema: envSnapshotJsonSchema,
171
+ },
172
+ sourceLocation: { file: 'src/index.ts', line: 1, column: 1 },
173
+ },
174
+ 'customEnv/restore': {
175
+ service: 'customEnv',
176
+ description: 'Restore Host-start original name+value for this id, or delete if added after start.',
177
+ invocation: { kind: 'direct' },
178
+ parameters: [
179
+ {
180
+ name: 'id',
181
+ description: 'stable row id from list().',
182
+ source: 'json',
183
+ codec: {
184
+ mode: 'strict',
185
+ typeSymbol: 'string',
186
+ create: restore$parameter$0$schema,
187
+ jsonSchema: { type: 'string' },
188
+ },
189
+ },
190
+ ],
191
+ result: {
192
+ mode: 'strict',
193
+ typeSymbol: '@woosau/dsh-custom-env/types#EnvSnapshot',
194
+ create: list$result$schema,
195
+ description: 'updated snapshot.',
196
+ jsonSchema: envSnapshotJsonSchema,
197
+ },
198
+ sourceLocation: { file: 'src/index.ts', line: 1, column: 1 },
199
+ },
200
+ 'customEnv/cliStatus': {
201
+ service: 'customEnv',
202
+ description: 'Compare the user-environment dsh with the launcher expected for this Host.',
203
+ invocation: { kind: 'direct' },
204
+ parameters: [],
205
+ result: {
206
+ mode: 'strict',
207
+ typeSymbol: '@woosau/dsh-custom-env/types#CliStatus',
208
+ create: cliStatus$result$schema,
209
+ description: 'active path, expected path, and whether Install should be offered.',
210
+ jsonSchema: cliStatusJsonSchema,
211
+ },
212
+ sourceLocation: { file: 'src/index.ts', line: 1, column: 1 },
213
+ },
214
+ 'customEnv/cliInstall': {
215
+ service: 'customEnv',
216
+ description: 'Install the expected CLI onto the Windows user PATH or as /usr/local/bin/dsh on macOS.',
217
+ invocation: { kind: 'direct' },
218
+ parameters: [],
219
+ result: {
220
+ mode: 'strict',
221
+ typeSymbol: '@woosau/dsh-custom-env/types#CliStatus',
222
+ create: cliStatus$result$schema,
223
+ description: 'refreshed status after install.',
224
+ jsonSchema: cliStatusJsonSchema,
225
+ },
226
+ sourceLocation: { file: 'src/index.ts', line: 1, column: 1 },
227
+ },
228
+ },
229
+ }, z)
230
+
231
+ export const TYPERT = {
232
+ package: '@woosau/dsh-custom-env',
233
+ face: 'host',
234
+ schemas: [],
235
+ get invocations() { return $remote.descriptors },
236
+ model: {
237
+ services: [
238
+ {
239
+ description: 'Host remote for $DSH_HOME/.env CRUD with live Host/OS sync.',
240
+ summary: 'Host remote for $DSH_HOME/.env CRUD with live Host/OS sync.',
241
+ tags: [],
242
+ jsDoc: '/** Host remote for `$DSH_HOME/.env` CRUD with live Host/OS sync. */',
243
+ key: 'customEnv',
244
+ exportName: 'default',
245
+ members: [
246
+ {
247
+ kind: 'method',
248
+ name: 'list',
249
+ signature: "@Remote('list') async list(): Promise<EnvSnapshot>",
250
+ summary: 'List current $DSH_HOME/.env entries.',
251
+ jsDoc: '/** List current `$DSH_HOME/.env` entries. */',
252
+ },
253
+ {
254
+ kind: 'method',
255
+ name: 'upsert',
256
+ signature: "@Remote('upsert') async upsert(id: string, name: string, value: string): Promise<EnvSnapshot>",
257
+ summary: 'Create or update one row by id.',
258
+ jsDoc: '/** Create (`id === ""`) or update/rename one row. */',
259
+ },
260
+ {
261
+ kind: 'method',
262
+ name: 'deleteEntry',
263
+ signature: "@Remote('deleteEntry') async deleteEntry(id: string): Promise<EnvSnapshot>",
264
+ summary: 'Delete one row by stable id.',
265
+ jsDoc: '/** Delete one entry by id. */',
266
+ },
267
+ {
268
+ kind: 'method',
269
+ name: 'restore',
270
+ signature: "@Remote('restore') async restore(id: string): Promise<EnvSnapshot>",
271
+ summary: 'Restore Host-start original name+value for this id.',
272
+ jsDoc: '/** Restore Host-start original name+value for this id. */',
273
+ },
274
+ {
275
+ kind: 'method',
276
+ name: 'cliStatus',
277
+ signature: "@Remote('cliStatus') async cliStatus(): Promise<CliStatus>",
278
+ summary: 'Compare user-environment dsh with this Host launcher.',
279
+ jsDoc: '/** Compare the user-environment `dsh` with the launcher expected for this Host. */',
280
+ },
281
+ {
282
+ kind: 'method',
283
+ name: 'cliInstall',
284
+ signature: "@Remote('cliInstall') async cliInstall(): Promise<CliStatus>",
285
+ summary: 'Install expected CLI onto PATH or /usr/local/bin/dsh.',
286
+ jsDoc: '/** Install the expected CLI onto the Windows user PATH or as `/usr/local/bin/dsh` on macOS. */',
287
+ },
288
+ ],
289
+ types: [],
290
+ },
291
+ ],
292
+ events: [],
293
+ objects: [],
294
+ },
295
+ }
@@ -0,0 +1,15 @@
1
+ /* Generated by @deepseek-ai/dsh-typert-generator from the Host FaceModel — do not edit. */
2
+ import type { TypertRemoteContribution } from '@deepseek-ai/dsh-typert-protocol'
3
+
4
+ declare const TYPERT_REMOTE: TypertRemoteContribution
5
+ export { TYPERT_REMOTE }
6
+ export default TYPERT_REMOTE
7
+
8
+ declare module '@deepseek-ai/dsh-typert-protocol' {
9
+ interface RemoteErrorDetailsMap {
10
+ 'custom-env/invalid-name': { readonly name: string }
11
+ 'custom-env/invalid-value': { readonly name: string }
12
+ 'custom-env/cli-install-failed': { readonly code: string }
13
+ 'custom-env/restore-failed': { readonly name: string }
14
+ }
15
+ }
@@ -0,0 +1,231 @@
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 list$result$schema$value
7
+ const list$result$schema = () => (list$result$schema$value ??= z.object({
8
+ path: z.string().readonly(),
9
+ exists: z.boolean().readonly(),
10
+ entries: z.array(z.object({
11
+ id: z.string().readonly(),
12
+ name: z.string().readonly(),
13
+ value: z.string().readonly(),
14
+ kind: z.enum(['unchanged', 'modified', 'added']).readonly(),
15
+ previous: z.string().nullable().readonly(),
16
+ }).readonly()).readonly(),
17
+ }))
18
+
19
+ let cliStatus$result$schema$value
20
+ const cliStatus$result$schema = () => (cliStatus$result$schema$value ??= z.object({
21
+ platform: z.string().readonly(),
22
+ activePath: z.string().nullable().readonly(),
23
+ expectedPath: z.string().nullable().readonly(),
24
+ expectedDirectory: z.string().nullable().readonly(),
25
+ matches: z.boolean().readonly(),
26
+ canInstall: z.boolean().readonly(),
27
+ reason: z.string().nullable().readonly(),
28
+ }))
29
+
30
+ let upsert$parameter$0$schema$value
31
+ const upsert$parameter$0$schema = () => (upsert$parameter$0$schema$value ??= z.string())
32
+ let upsert$parameter$1$schema$value
33
+ const upsert$parameter$1$schema = () => (upsert$parameter$1$schema$value ??= z.string())
34
+ let upsert$parameter$2$schema$value
35
+ const upsert$parameter$2$schema = () => (upsert$parameter$2$schema$value ??= z.string())
36
+
37
+ let remove$parameter$0$schema$value
38
+ const remove$parameter$0$schema = () => (remove$parameter$0$schema$value ??= z.string())
39
+
40
+ let restore$parameter$0$schema$value
41
+ const restore$parameter$0$schema = () => (restore$parameter$0$schema$value ??= z.string())
42
+
43
+ const cliStatusJsonSchema = {
44
+ type: 'object',
45
+ properties: {
46
+ platform: { type: 'string' },
47
+ activePath: { type: ['string', 'null'] },
48
+ expectedPath: { type: ['string', 'null'] },
49
+ expectedDirectory: { type: ['string', 'null'] },
50
+ matches: { type: 'boolean' },
51
+ canInstall: { type: 'boolean' },
52
+ reason: { type: ['string', 'null'] },
53
+ },
54
+ required: ['platform', 'activePath', 'expectedPath', 'expectedDirectory', 'matches', 'canInstall', 'reason'],
55
+ additionalProperties: true,
56
+ }
57
+
58
+ const envSnapshotJsonSchema = {
59
+ type: 'object',
60
+ properties: {
61
+ path: { type: 'string' },
62
+ exists: { type: 'boolean' },
63
+ entries: {
64
+ type: 'array',
65
+ items: {
66
+ type: 'object',
67
+ properties: {
68
+ id: { type: 'string' },
69
+ name: { type: 'string' },
70
+ value: { type: 'string' },
71
+ kind: { type: 'string', enum: ['unchanged', 'modified', 'added'] },
72
+ previous: { type: ['string', 'null'] },
73
+ },
74
+ required: ['id', 'name', 'value', 'kind', 'previous'],
75
+ additionalProperties: true,
76
+ },
77
+ },
78
+ },
79
+ required: ['path', 'exists', 'entries'],
80
+ additionalProperties: true,
81
+ }
82
+
83
+ export const TYPERT_REMOTE = createTypertRemoteInfo({
84
+ package: '@woosau/dsh-custom-env',
85
+ methods: {
86
+ 'customEnv/list': {
87
+ service: 'customEnv',
88
+ description: 'List current $DSH_HOME/.env entries with pending classification.',
89
+ invocation: { kind: 'direct' },
90
+ parameters: [],
91
+ result: {
92
+ mode: 'strict',
93
+ typeSymbol: '@woosau/dsh-custom-env/types#EnvSnapshot',
94
+ create: list$result$schema,
95
+ description: 'path, existence, and sorted entries.',
96
+ jsonSchema: envSnapshotJsonSchema,
97
+ },
98
+ sourceLocation: { file: 'src/index.ts', line: 1, column: 1 },
99
+ },
100
+ 'customEnv/upsert': {
101
+ service: 'customEnv',
102
+ description: 'Create or update one row. Empty id creates a new row; otherwise keeps that baseline id across renames.',
103
+ invocation: { kind: 'direct' },
104
+ parameters: [
105
+ {
106
+ name: 'id',
107
+ description: 'stable row id from list(), or empty string for a new row.',
108
+ source: 'json',
109
+ codec: {
110
+ mode: 'strict',
111
+ typeSymbol: 'string',
112
+ create: upsert$parameter$0$schema,
113
+ jsonSchema: { type: 'string' },
114
+ },
115
+ },
116
+ {
117
+ name: 'name',
118
+ description: 'writable variable name.',
119
+ source: 'json',
120
+ codec: {
121
+ mode: 'strict',
122
+ typeSymbol: 'string',
123
+ create: upsert$parameter$1$schema,
124
+ jsonSchema: { type: 'string' },
125
+ },
126
+ },
127
+ {
128
+ name: 'value',
129
+ description: 'non-empty value.',
130
+ source: 'json',
131
+ codec: {
132
+ mode: 'strict',
133
+ typeSymbol: 'string',
134
+ create: upsert$parameter$2$schema,
135
+ jsonSchema: { type: 'string' },
136
+ },
137
+ },
138
+ ],
139
+ result: {
140
+ mode: 'strict',
141
+ typeSymbol: '@woosau/dsh-custom-env/types#EnvSnapshot',
142
+ create: list$result$schema,
143
+ description: 'updated snapshot.',
144
+ jsonSchema: envSnapshotJsonSchema,
145
+ },
146
+ sourceLocation: { file: 'src/index.ts', line: 1, column: 1 },
147
+ },
148
+ 'customEnv/deleteEntry': {
149
+ service: 'customEnv',
150
+ description: 'Delete one entry from the file, Host, and OS user environment.',
151
+ invocation: { kind: 'direct' },
152
+ parameters: [
153
+ {
154
+ name: 'id',
155
+ description: 'stable row id from list().',
156
+ source: 'json',
157
+ codec: {
158
+ mode: 'strict',
159
+ typeSymbol: 'string',
160
+ create: remove$parameter$0$schema,
161
+ jsonSchema: { type: 'string' },
162
+ },
163
+ },
164
+ ],
165
+ result: {
166
+ mode: 'strict',
167
+ typeSymbol: '@woosau/dsh-custom-env/types#EnvSnapshot',
168
+ create: list$result$schema,
169
+ description: 'updated snapshot.',
170
+ jsonSchema: envSnapshotJsonSchema,
171
+ },
172
+ sourceLocation: { file: 'src/index.ts', line: 1, column: 1 },
173
+ },
174
+ 'customEnv/restore': {
175
+ service: 'customEnv',
176
+ description: 'Restore Host-start original name+value for this id, or delete if added after start.',
177
+ invocation: { kind: 'direct' },
178
+ parameters: [
179
+ {
180
+ name: 'id',
181
+ description: 'stable row id from list().',
182
+ source: 'json',
183
+ codec: {
184
+ mode: 'strict',
185
+ typeSymbol: 'string',
186
+ create: restore$parameter$0$schema,
187
+ jsonSchema: { type: 'string' },
188
+ },
189
+ },
190
+ ],
191
+ result: {
192
+ mode: 'strict',
193
+ typeSymbol: '@woosau/dsh-custom-env/types#EnvSnapshot',
194
+ create: list$result$schema,
195
+ description: 'updated snapshot.',
196
+ jsonSchema: envSnapshotJsonSchema,
197
+ },
198
+ sourceLocation: { file: 'src/index.ts', line: 1, column: 1 },
199
+ },
200
+ 'customEnv/cliStatus': {
201
+ service: 'customEnv',
202
+ description: 'Compare the user-environment dsh with the launcher expected for this Host.',
203
+ invocation: { kind: 'direct' },
204
+ parameters: [],
205
+ result: {
206
+ mode: 'strict',
207
+ typeSymbol: '@woosau/dsh-custom-env/types#CliStatus',
208
+ create: cliStatus$result$schema,
209
+ description: 'active path, expected path, and whether Install should be offered.',
210
+ jsonSchema: cliStatusJsonSchema,
211
+ },
212
+ sourceLocation: { file: 'src/index.ts', line: 1, column: 1 },
213
+ },
214
+ 'customEnv/cliInstall': {
215
+ service: 'customEnv',
216
+ description: 'Install the expected CLI onto the Windows user PATH or as /usr/local/bin/dsh on macOS.',
217
+ invocation: { kind: 'direct' },
218
+ parameters: [],
219
+ result: {
220
+ mode: 'strict',
221
+ typeSymbol: '@woosau/dsh-custom-env/types#CliStatus',
222
+ create: cliStatus$result$schema,
223
+ description: 'refreshed status after install.',
224
+ jsonSchema: cliStatusJsonSchema,
225
+ },
226
+ sourceLocation: { file: 'src/index.ts', line: 1, column: 1 },
227
+ },
228
+ },
229
+ }, z)
230
+
231
+ export default TYPERT_REMOTE
@@ -0,0 +1,12 @@
1
+ /** CLI PATH status and install entry points for the Host remote. */
2
+ import { type CliStatus } from './status.ts';
3
+ export type { CliStatus } from './status.ts';
4
+ /**
5
+ * Report whether the user-environment `dsh` matches this Host's expected launcher.
6
+ */
7
+ export declare function cliStatus(): Promise<CliStatus>;
8
+ /**
9
+ * Install the expected CLI into the user environment (Windows PATH / macOS symlink).
10
+ * @returns refreshed status after install.
11
+ */
12
+ export declare function cliInstall(): Promise<CliStatus>;
@@ -0,0 +1,33 @@
1
+ /** Locate the first `dsh` visible on the user + machine PATH. */
2
+ declare const MAC_DESTINATION = "/usr/local/bin/dsh";
3
+ /** Result of scanning PATH for an active dsh command. */
4
+ export interface ActiveCli {
5
+ /** Absolute path of the first matching launcher, if any. */
6
+ readonly path: string | undefined;
7
+ /** When `path` is a symlink, its resolved target (macOS / POSIX). */
8
+ readonly symlinkTarget: string | undefined;
9
+ }
10
+ /** Inputs for tests. */
11
+ export interface InspectActiveOptions {
12
+ readonly platform?: NodeJS.Platform;
13
+ readonly pathEnv?: string | undefined;
14
+ readonly machinePath?: string | undefined;
15
+ readonly pathext?: string | undefined;
16
+ readonly exists?: (path: string) => boolean;
17
+ readonly isExecutable?: (path: string) => boolean;
18
+ readonly readLink?: (path: string) => string | undefined;
19
+ }
20
+ /**
21
+ * Find the first `dsh` on PATH (machine then user on Windows).
22
+ * @param options - optional env overrides for tests.
23
+ */
24
+ export declare function inspectActiveCli(options?: InspectActiveOptions): ActiveCli;
25
+ /**
26
+ * Whether the active CLI matches the expected launcher.
27
+ * On macOS, prefer symlink target comparison when active is `/usr/local/bin/dsh`.
28
+ * @param active - PATH scan result.
29
+ * @param expectedLauncher - expected absolute launcher.
30
+ * @param platform - override for tests.
31
+ */
32
+ export declare function activeMatchesExpected(active: ActiveCli, expectedLauncher: string, platform?: NodeJS.Platform): boolean;
33
+ export { MAC_DESTINATION };
@@ -0,0 +1,21 @@
1
+ /** macOS: install `/usr/local/bin/dsh` → expected launcher (may conflict with Desktop). */
2
+ /** Fixed public command path used by Desktop and this plugin. */
3
+ export declare const MAC_CLI_DESTINATION = "/usr/local/bin/dsh";
4
+ /** Receipt owned by this plugin (never `.dsh-desktop-command.json`). */
5
+ export declare const MAC_CLI_RECEIPT = "/usr/local/bin/.dsh-custom-env-command.json";
6
+ declare class MacosCommandError extends Error {
7
+ readonly code: string;
8
+ constructor(code: string, message: string);
9
+ }
10
+ /**
11
+ * Read the current symlink target at the public destination, if any.
12
+ * @param destination - absolute path (default `/usr/local/bin/dsh`).
13
+ */
14
+ export declare function readMacosCliLink(destination?: string): string | undefined;
15
+ /**
16
+ * Install or repair the `/usr/local/bin/dsh` symlink to `launcher`.
17
+ * Elevates with osascript when the first attempt hits EACCES.
18
+ * @param launcher - absolute path of the expected `dsh` script.
19
+ */
20
+ export declare function installMacosCliLink(launcher: string): Promise<void>;
21
+ export { MacosCommandError };
@@ -0,0 +1,46 @@
1
+ /** Shared path helpers for CLI install status. */
2
+ import { existsSync } from 'node:fs';
3
+ import { basename, dirname, isAbsolute, join, normalize, resolve, sep } from 'node:path';
4
+ /** Launcher file name for the current platform. */
5
+ export declare function launcherName(platform?: NodeJS.Platform): string;
6
+ /**
7
+ * Compare two absolute paths for equality.
8
+ * @param left - first path.
9
+ * @param right - second path.
10
+ * @param platform - override for tests.
11
+ */
12
+ export declare function samePath(left: string, right: string, platform?: NodeJS.Platform): boolean;
13
+ /**
14
+ * Normalize a path for comparison (absolute, trimmed separators; lower-case on Windows).
15
+ * @param path - input path.
16
+ * @param platform - override for tests.
17
+ */
18
+ export declare function normalizeComparable(path: string, platform?: NodeJS.Platform): string;
19
+ /**
20
+ * Resolve `…/resources` next to an Electron executable when present.
21
+ * @param execPath - `process.execPath`.
22
+ * @param platform - override for tests.
23
+ * @param exists - filesystem probe.
24
+ * @returns resources directory or `undefined`.
25
+ */
26
+ export declare function findElectronResources(execPath: string, platform?: NodeJS.Platform, exists?: (path: string) => boolean): string | undefined;
27
+ /**
28
+ * Walk parents of `start` looking for a directory that contains the launcher.
29
+ * @param start - file or directory to start from.
30
+ * @param platform - override for tests.
31
+ * @param maxHops - parent hops.
32
+ * @param exists - filesystem probe.
33
+ */
34
+ export declare function findLauncherDirectory(start: string, platform?: NodeJS.Platform, maxHops?: number, exists?: (path: string) => boolean): string | undefined;
35
+ /**
36
+ * Whether `argv1` looks like a DSH CLI entry script.
37
+ * @param argv1 - `process.argv[1]`.
38
+ */
39
+ export declare function looksLikeCliEntry(argv1: string | undefined): boolean;
40
+ /**
41
+ * Join PATH-like segments with the platform separator.
42
+ * @param parts - path segments (may be empty).
43
+ * @param platform - override for tests.
44
+ */
45
+ export declare function joinPathEnv(parts: readonly string[], platform?: NodeJS.Platform): string;
46
+ export { dirname, existsSync, isAbsolute, join, normalize, resolve, sep, basename };