@hellolynk-ai/codex-plugin 0.2.102 → 0.2.103

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.
Files changed (36) hide show
  1. package/bin/hellolynk-client-setup.mjs +70 -10
  2. package/hellolynk-client-pack-manifest.json +76 -56
  3. package/hellolynk-client-pack-pin.json +1 -1
  4. package/package.json +1 -1
  5. package/plugins/hellolynk-codex/.codex-plugin/plugin.json +1 -1
  6. package/plugins/hellolynk-codex/package.json +1 -1
  7. package/plugins/hellolynk-codex/runtime/bootstrap/core/hellolynk-client-account.mjs +1 -1
  8. package/plugins/hellolynk-codex/runtime/bootstrap/core/hellolynk-darwin-host.mjs +269 -0
  9. package/plugins/hellolynk-codex/runtime/bootstrap/core/hellolynk-darwin-vault.mjs +153 -0
  10. package/plugins/hellolynk-codex/runtime/bootstrap/core/hellolynk-host-protected-store.mjs +20 -8
  11. package/plugins/hellolynk-codex/runtime/bootstrap/core/hellolynk-neutral-host-installation-store.mjs +1 -1
  12. package/plugins/hellolynk-codex/runtime/bootstrap/core/hellolynk-platform-credential-store.mjs +68 -14
  13. package/plugins/hellolynk-codex/runtime/connect-activate.mjs +5 -1
  14. package/plugins/hellolynk-codex/runtime/core/hellolynk-client-account.mjs +1 -1
  15. package/plugins/hellolynk-codex/runtime/core/hellolynk-client-update-entry.mjs +7 -3
  16. package/plugins/hellolynk-codex/runtime/core/hellolynk-client-update-runtime.mjs +62 -33
  17. package/plugins/hellolynk-codex/runtime/core/hellolynk-client-update.mjs +62 -18
  18. package/plugins/hellolynk-codex/runtime/core/hellolynk-darwin-host.mjs +269 -0
  19. package/plugins/hellolynk-codex/runtime/core/hellolynk-darwin-vault.mjs +153 -0
  20. package/plugins/hellolynk-codex/runtime/core/hellolynk-host-protected-store.mjs +20 -8
  21. package/plugins/hellolynk-codex/runtime/core/hellolynk-human-confirmation-ledger.mjs +53 -6
  22. package/plugins/hellolynk-codex/runtime/core/hellolynk-local-data-protection.mjs +22 -7
  23. package/plugins/hellolynk-codex/runtime/core/hellolynk-native-human-confirmation-broker.mjs +7 -5
  24. package/plugins/hellolynk-codex/runtime/core/hellolynk-neutral-host-installation-store.mjs +1 -1
  25. package/plugins/hellolynk-codex/runtime/core/hellolynk-neutral-host-launcher.mjs +9 -3
  26. package/plugins/hellolynk-codex/runtime/core/hellolynk-neutral-host-process.mjs +1 -1
  27. package/plugins/hellolynk-codex/runtime/core/hellolynk-platform-credential-store.mjs +68 -14
  28. package/plugins/hellolynk-codex/runtime/core/hellolynk-release-retention.mjs +101 -2
  29. package/plugins/hellolynk-codex/runtime/core/hellolynk-workbench-connection.mjs +5 -3
  30. package/plugins/hellolynk-codex/runtime/neutral-host-release-entry.mjs +1 -1
  31. package/plugins/hellolynk-codex/runtime/neutral-host-release-loader.mjs +1 -1
  32. package/plugins/hellolynk-codex/runtime/neutral-host-release-manifest.json +40 -24
  33. package/plugins/hellolynk-codex/runtime/neutral-host-release-pin.json +1 -1
  34. package/plugins/hellolynk-codex/runtime/platform/windows/credential-store.ps1 +46 -10
  35. package/plugins/hellolynk-codex/server/codex-neutral-production.mjs +14 -8
  36. package/tools/hellolynk-activate-neutral-host-clients.mjs +5 -1
@@ -4,7 +4,7 @@
4
4
  "files": [
5
5
  {
6
6
  "path": "release/package.json",
7
- "sha256": "befbca064334e8ff7f9d192f095ac1bd786a3882385a450fc2c2d2a5c9b2b7dd"
7
+ "sha256": "f786baab2e9f35836813c6b77e1cbc0fb8c0a3c0a2055b2e6ea777f2428cd232"
8
8
  },
9
9
  {
10
10
  "path": "neutral-host-bootstrap.mjs",
@@ -12,15 +12,15 @@
12
12
  },
13
13
  {
14
14
  "path": "connect-activate.mjs",
15
- "sha256": "50ec8b0a58ac5b099a653722b0946acb23d0a29a054bfb3856dc963db6f84bee"
15
+ "sha256": "93c68c23ed2d18e87766ecd8dae6c3d8e757eca6ad7569477c8ec994402a8b0e"
16
16
  },
17
17
  {
18
18
  "path": "neutral-host-release-loader.mjs",
19
- "sha256": "15593e237fd5cbd765b65e60efe7a1c87e24a5390ad932c8a23d2c03b8da9770"
19
+ "sha256": "283a20c6a9b90481bc03c143ab51d5289abf7b7a86fbe51fba7ea2ae1e6d2c60"
20
20
  },
21
21
  {
22
22
  "path": "neutral-host-release-entry.mjs",
23
- "sha256": "23e88d39362fe556eb96f86b2ac9740c0390f33f01edee5c89d708c80c4f8fa6"
23
+ "sha256": "698d7e80d38353d56c7f1c337fbc676e8649d08afc726ffcb31215dc11fc8455"
24
24
  },
25
25
  {
26
26
  "path": "core/hellolynk-agent-configurator.mjs",
@@ -28,7 +28,7 @@
28
28
  },
29
29
  {
30
30
  "path": "core/hellolynk-client-account.mjs",
31
- "sha256": "ab7ec5dda92e510e7deb14f900fd2df4c6c3373fbeb4af4fb2b6c1a72aa41a99"
31
+ "sha256": "6e03a05127d4dc86be6391567b51a956d1a987acf4e23f5699ce0e00c3187b7e"
32
32
  },
33
33
  {
34
34
  "path": "core/hellolynk-client-core.mjs",
@@ -40,19 +40,19 @@
40
40
  },
41
41
  {
42
42
  "path": "core/hellolynk-client-update-entry.mjs",
43
- "sha256": "b2740406d79d0fa129c3bd1b5e6a07c3f52eed5e35a91ffea40b099ddc708936"
43
+ "sha256": "d9548eacda8632976e42aafc65f0cef2ec9c5233d2d53b31b02aec0a1702b5eb"
44
44
  },
45
45
  {
46
46
  "path": "core/hellolynk-client-update-runtime.mjs",
47
- "sha256": "3ed31f0cea704c3ad26481126a78a7d39c21df69a5c52d1074a096a2b7b3e32f"
47
+ "sha256": "aa233e2cdbdfadb7da6aa489591bc12c4121101b94696f93f6e6cb5d3e7c7870"
48
48
  },
49
49
  {
50
50
  "path": "core/hellolynk-client-update.mjs",
51
- "sha256": "8f0d6f54313c91bd2ffb4643859a91dd1e122bb5f1da9143fe2851a3370d7fbf"
51
+ "sha256": "e57f7cc5e98519a014cef7cef68a97bb7e2beb33eb381c38d1751a3967904aaa"
52
52
  },
53
53
  {
54
54
  "path": "core/hellolynk-release-retention.mjs",
55
- "sha256": "9b02a42a510fa5ef4a251b6e675f9ccc60f20b718d17c1617027cd048c5634dd"
55
+ "sha256": "0ee150af5a9bcc1f636e3ff980ee90ce7d073ab5ed4a991920cd3472bc65529c"
56
56
  },
57
57
  {
58
58
  "path": "core/hellolynk-contact-request-e2ee.mjs",
@@ -62,6 +62,14 @@
62
62
  "path": "core/hellolynk-device-enrollment.mjs",
63
63
  "sha256": "f3e99ff2bdfa76e5a830a518792a1b9e5e705d7a8a01eca725dd7c5c8391d4ef"
64
64
  },
65
+ {
66
+ "path": "core/hellolynk-darwin-host.mjs",
67
+ "sha256": "ded97c3bc3dd65ca75305f5199a1340dffb987a5f283454d60586df8b6b55c09"
68
+ },
69
+ {
70
+ "path": "core/hellolynk-darwin-vault.mjs",
71
+ "sha256": "b6094d856af016e674e4a0183a4e474397bbe92e66638743fa62fe085b554d30"
72
+ },
65
73
  {
66
74
  "path": "core/hellolynk-direct-text-e2ee-client.mjs",
67
75
  "sha256": "4007bf5e6c91df00adf10384cc1f0d0d28491b8ded518365dddbac717f3ac5be"
@@ -76,7 +84,7 @@
76
84
  },
77
85
  {
78
86
  "path": "core/hellolynk-host-protected-store.mjs",
79
- "sha256": "89b6e6c4ce9c6ba2984f8c301de4251da6004bdd402cc44d578a4505c21b75b1"
87
+ "sha256": "10f81f4f6a5dd2fe9a742e847b2eb47dbf20f802f4414f46a05ccbc3505148e2"
80
88
  },
81
89
  {
82
90
  "path": "core/hellolynk-host-transport-client.mjs",
@@ -108,7 +116,7 @@
108
116
  },
109
117
  {
110
118
  "path": "core/hellolynk-human-confirmation-ledger.mjs",
111
- "sha256": "63bcbbb0870ad83fc031636d74ce77fc070d5f4d1d4c10297f8b3ec9ad85bbf6"
119
+ "sha256": "43b6b6baea422eb226c850f15966c907d834bc2f5aadbab6ee0c9e05445f182f"
112
120
  },
113
121
  {
114
122
  "path": "core/hellolynk-human-relationship-controller.mjs",
@@ -140,7 +148,7 @@
140
148
  },
141
149
  {
142
150
  "path": "core/hellolynk-local-data-protection.mjs",
143
- "sha256": "1bda879aa0bdf46700a63374e82cc7bc639385656b1463a75a49e8510971066c"
151
+ "sha256": "cea4f73ec5a31918c48bd8234e28d38ff1bb8028d2591f542b15ee12b2238e1f"
144
152
  },
145
153
  {
146
154
  "path": "core/hellolynk-local-identity-trust.mjs",
@@ -172,7 +180,7 @@
172
180
  },
173
181
  {
174
182
  "path": "core/hellolynk-native-human-confirmation-broker.mjs",
175
- "sha256": "2fb2d3b40869362be3e40a1ec55947021319af5315cbf8fdc5ed59df717cceb3"
183
+ "sha256": "f190c28af2703b58a685a57213b2789df7eda35d7699d718f9420cd1dddd1b65"
176
184
  },
177
185
  {
178
186
  "path": "core/hellolynk-neutral-host-assembly.mjs",
@@ -180,15 +188,15 @@
180
188
  },
181
189
  {
182
190
  "path": "core/hellolynk-neutral-host-installation-store.mjs",
183
- "sha256": "dfb6bba4c627082cd6fca8cb38dc786f905e38f3e83ccf91dbfe57e55639e8a2"
191
+ "sha256": "42ae1e7deb876a8308b7bfed6a7b891d1834117b62504fc5befe3f91a0b4c740"
184
192
  },
185
193
  {
186
194
  "path": "core/hellolynk-neutral-host-launcher.mjs",
187
- "sha256": "789b2531cdbde6e6d8f91f2a40746372e903e9e48e8aa6846b9abf2d28150780"
195
+ "sha256": "d94b853a7ed1ebc9c7e9bd7c37e2405e39849fb6d4ddf3d697e17ba169eda6d2"
188
196
  },
189
197
  {
190
198
  "path": "core/hellolynk-neutral-host-process.mjs",
191
- "sha256": "e744bacf65f7b86cbcf7d654189c0e07e09401083e2b6f9053b17c1c3bacd1b4"
199
+ "sha256": "7b237a1400c604da5decbb29ab3ce556fd1b744d0cfd7d28b5560b217da120b1"
192
200
  },
193
201
  {
194
202
  "path": "core/hellolynk-neutral-host-store-adapters.mjs",
@@ -200,7 +208,7 @@
200
208
  },
201
209
  {
202
210
  "path": "core/hellolynk-platform-credential-store.mjs",
203
- "sha256": "f27f5f377cc4d6d2b5664212cf8fcc4c98d910064c1677ff9c1f776df1a59dba"
211
+ "sha256": "3969708bafefc3b267bb34a9dcc115804c874ad14f4a036426d727c02ff70d42"
204
212
  },
205
213
  {
206
214
  "path": "core/hellolynk-relay-client-cli.mjs",
@@ -216,7 +224,7 @@
216
224
  },
217
225
  {
218
226
  "path": "core/hellolynk-workbench-connection.mjs",
219
- "sha256": "d3396350fd75af78e60772e021cf6dfb643d9eee41894c5461c959a56650cb60"
227
+ "sha256": "6ce8e75025d31ed81c39150df2766231fc871ef18c234de986dc910bab79d639"
220
228
  },
221
229
  {
222
230
  "path": "workbench/candidate-bootstrap.mjs",
@@ -284,7 +292,7 @@
284
292
  },
285
293
  {
286
294
  "path": "platform/windows/credential-store.ps1",
287
- "sha256": "d00dae4af08205fffa52c4956d1c87d5c3423e8f20982ccfc1b76e3424fe442e"
295
+ "sha256": "8f288c91a1f6ecaf2651baab9bdfc55014c11ea9e165f203ca7a69f4d47d7917"
288
296
  },
289
297
  {
290
298
  "path": "platform/windows/hellolynk-host-protected-store.ps1",
@@ -302,9 +310,17 @@
302
310
  "path": "platform/windows/hellolynk-native-human-confirmation-broker.ps1",
303
311
  "sha256": "757a731a3e8761d5d473db19ecfc330783f2826663a0057c4d6896e679d7a388"
304
312
  },
313
+ {
314
+ "path": "bootstrap/core/hellolynk-darwin-host.mjs",
315
+ "sha256": "ded97c3bc3dd65ca75305f5199a1340dffb987a5f283454d60586df8b6b55c09"
316
+ },
317
+ {
318
+ "path": "bootstrap/core/hellolynk-darwin-vault.mjs",
319
+ "sha256": "b6094d856af016e674e4a0183a4e474397bbe92e66638743fa62fe085b554d30"
320
+ },
305
321
  {
306
322
  "path": "bootstrap/core/hellolynk-client-account.mjs",
307
- "sha256": "ab7ec5dda92e510e7deb14f900fd2df4c6c3373fbeb4af4fb2b6c1a72aa41a99"
323
+ "sha256": "6e03a05127d4dc86be6391567b51a956d1a987acf4e23f5699ce0e00c3187b7e"
308
324
  },
309
325
  {
310
326
  "path": "bootstrap/core/hellolynk-client-core.mjs",
@@ -320,7 +336,7 @@
320
336
  },
321
337
  {
322
338
  "path": "bootstrap/core/hellolynk-host-protected-store.mjs",
323
- "sha256": "89b6e6c4ce9c6ba2984f8c301de4251da6004bdd402cc44d578a4505c21b75b1"
339
+ "sha256": "10f81f4f6a5dd2fe9a742e847b2eb47dbf20f802f4414f46a05ccbc3505148e2"
324
340
  },
325
341
  {
326
342
  "path": "bootstrap/core/hellolynk-local-process-lock.mjs",
@@ -328,11 +344,11 @@
328
344
  },
329
345
  {
330
346
  "path": "bootstrap/core/hellolynk-neutral-host-installation-store.mjs",
331
- "sha256": "dfb6bba4c627082cd6fca8cb38dc786f905e38f3e83ccf91dbfe57e55639e8a2"
347
+ "sha256": "42ae1e7deb876a8308b7bfed6a7b891d1834117b62504fc5befe3f91a0b4c740"
332
348
  },
333
349
  {
334
350
  "path": "bootstrap/core/hellolynk-platform-credential-store.mjs",
335
- "sha256": "f27f5f377cc4d6d2b5664212cf8fcc4c98d910064c1677ff9c1f776df1a59dba"
351
+ "sha256": "3969708bafefc3b267bb34a9dcc115804c874ad14f4a036426d727c02ff70d42"
336
352
  },
337
353
  {
338
354
  "path": "bootstrap/core/hellolynk-runtime-safety.cjs",
@@ -344,7 +360,7 @@
344
360
  },
345
361
  {
346
362
  "path": "release/server/codex-neutral-production.mjs",
347
- "sha256": "7b3249f1b35c331cf2b00ac2873a54d12fc6f61cf341bb82cec98e49ce221b92"
363
+ "sha256": "e1106264be25cd79fc12f1b774726089eead0f7e237aff231cd739f40e0c1f40"
348
364
  },
349
365
  {
350
366
  "path": "release/server/neutral-host-adapter.mjs",
@@ -1,4 +1,4 @@
1
1
  {
2
2
  "contract": "hellolynk-neutral-host-release-pin-v1",
3
- "manifestSha256": "3f8ad933949136ed1ebf5172c9e49ead0b0e2829650bc960eef1bdddd27c6a8f"
3
+ "manifestSha256": "7aff02867e6f806b2d20c060e4d6ba50c55ad9b23448e65e74a15aabcc99a4d5"
4
4
  }
@@ -85,8 +85,27 @@ public static class HelloLynkWindowsFileNative {
85
85
  [DllImport("kernel32.dll", CharSet = CharSet.Unicode, SetLastError = true)]
86
86
  public static extern bool MoveFileExW(string existingName, string newName, uint flags);
87
87
 
88
+ [StructLayout(LayoutKind.Sequential)]
89
+ private struct SECURITY_ATTRIBUTES {
90
+ public int Length;
91
+ public IntPtr SecurityDescriptor;
92
+ public int InheritHandle;
93
+ }
94
+
88
95
  [DllImport("kernel32.dll", CharSet = CharSet.Unicode, SetLastError = true)]
89
- public static extern bool CreateDirectoryW(string path, IntPtr securityAttributes);
96
+ private static extern bool CreateDirectoryW(string path, ref SECURITY_ATTRIBUTES attributes);
97
+
98
+ public static bool CreateProtectedDirectory(string path, byte[] descriptor) {
99
+ var pinned = GCHandle.Alloc(descriptor, GCHandleType.Pinned);
100
+ try {
101
+ var attributes = new SECURITY_ATTRIBUTES {
102
+ Length = Marshal.SizeOf<SECURITY_ATTRIBUTES>(),
103
+ SecurityDescriptor = pinned.AddrOfPinnedObject(),
104
+ InheritHandle = 0
105
+ };
106
+ return CreateDirectoryW(path, ref attributes);
107
+ } finally { pinned.Free(); }
108
+ }
90
109
  }
91
110
  '@
92
111
 
@@ -162,7 +181,7 @@ function Get-HelloLynkExistingAncestorDirectories([string]$RootPath) {
162
181
  return $ordered
163
182
  }
164
183
 
165
- function Assert-HelloLynkTrustedAncestorAcl([string]$RootPath) {
184
+ function Assert-HelloLynkTrustedAncestorAcl([string]$RootPath, [bool]$Create = $false) {
166
185
  $rootParent = [IO.Path]::GetDirectoryName($RootPath.TrimEnd([char[]]@('\', '/')))
167
186
  $directories = @(Get-HelloLynkExistingAncestorDirectories $RootPath)
168
187
  $dangerousRights = (
@@ -175,6 +194,8 @@ function Assert-HelloLynkTrustedAncestorAcl([string]$RootPath) {
175
194
  [Security.AccessControl.FileSystemRights]::ChangePermissions -bor
176
195
  [Security.AccessControl.FileSystemRights]::TakeOwnership
177
196
  )
197
+ $createRights = [Security.AccessControl.FileSystemRights]::CreateFiles -bor
198
+ [Security.AccessControl.FileSystemRights]::CreateDirectories
178
199
  foreach ($directory in $directories) {
179
200
  Assert-HelloLynkNoReparseAncestors $directory
180
201
  $identity = Open-HelloLynkIdentity $directory $true
@@ -204,6 +225,7 @@ function Assert-HelloLynkTrustedAncestorAcl([string]$RootPath) {
204
225
  )
205
226
  $isRootParent = $directory.Equals($rootParent, [StringComparison]::OrdinalIgnoreCase)
206
227
  $directoryIndex = [Array]::IndexOf($directories, $directory)
228
+ $willCreateProtectedChild = $Create -and -not $isRootParent -and $directoryIndex -eq $directories.Count - 1
207
229
  $nextDirectoryProtected = $false
208
230
  if ($directoryIndex -ge 0 -and $directoryIndex + 1 -lt $directories.Count) {
209
231
  try {
@@ -220,15 +242,20 @@ function Assert-HelloLynkTrustedAncestorAcl([string]$RootPath) {
220
242
  ) { continue }
221
243
  $rights = $rule.FileSystemRights
222
244
  $hasDangerousRights = (($rights -band $dangerousRights) -ne 0)
245
+ # A competing child created by a different user fails our owner check.
246
+ # A grant to alter the ancestor itself still prevents first creation.
247
+ $canCreateProtectedChild = $willCreateProtectedChild -and
248
+ (($rights -band $dangerousRights -band (-bnot $createRights)) -eq 0)
223
249
  $hasDeleteChild = (
224
250
  ($rights -band [Security.AccessControl.FileSystemRights]::DeleteSubdirectoriesAndFiles) -ne 0
225
251
  )
226
252
  if (
227
253
  $hasDeleteChild -or
228
- ($hasDangerousRights -and ($isRootParent -or -not $nextDirectoryProtected))
254
+ ($hasDangerousRights -and ($isRootParent -or (-not $nextDirectoryProtected -and -not $canCreateProtectedChild)))
229
255
  ) { Fail "client_root_ancestor_dacl_untrusted" }
230
256
  }
231
257
  }
258
+ return $directories[-1]
232
259
  }
233
260
 
234
261
  function New-HelloLynkAcl([bool]$Directory) {
@@ -361,7 +388,7 @@ function Exit-HelloLynkRootMutex($Mutex) {
361
388
  try { $Mutex.ReleaseMutex() } finally { $Mutex.Dispose() }
362
389
  }
363
390
 
364
- function Ensure-HelloLynkSecureDirectory([string]$PathValue) {
391
+ function Ensure-HelloLynkSecureDirectory([string]$PathValue, [string]$ExistingAncestor = "") {
365
392
  if ([IO.Directory]::Exists($PathValue)) {
366
393
  Assert-HelloLynkNoReparseAncestors $PathValue
367
394
  Assert-HelloLynkSecureAcl $PathValue $true
@@ -370,12 +397,21 @@ function Ensure-HelloLynkSecureDirectory([string]$PathValue) {
370
397
  return
371
398
  }
372
399
  $parent = [IO.Path]::GetDirectoryName($PathValue)
373
- if (-not [IO.Directory]::Exists($parent)) { Ensure-HelloLynkSecureDirectory $parent }
374
- if (-not [HelloLynkWindowsFileNative]::CreateDirectoryW($PathValue, [IntPtr]::Zero)) {
400
+ if ($ExistingAncestor) {
401
+ if (-not $parent.Equals($ExistingAncestor, [StringComparison]::OrdinalIgnoreCase)) {
402
+ Ensure-HelloLynkSecureDirectory $parent $ExistingAncestor
403
+ }
404
+ } elseif (-not [IO.Directory]::Exists($parent)) {
405
+ Ensure-HelloLynkSecureDirectory $parent
406
+ }
407
+ Assert-HelloLynkNoReparseAncestors $PathValue
408
+ $descriptor = (New-HelloLynkAcl $true).GetSecurityDescriptorBinaryForm()
409
+ if (-not [HelloLynkWindowsFileNative]::CreateProtectedDirectory($PathValue, $descriptor)) {
375
410
  Fail "client_root_create_race"
376
411
  }
377
- Set-HelloLynkSecureAcl $PathValue $true
378
412
  Assert-HelloLynkNoReparseAncestors $PathValue
413
+ # Keep the Windows auto-inheritance marker used by child file ACL checks.
414
+ Set-HelloLynkSecureAcl $PathValue $true
379
415
  Assert-HelloLynkSecureAcl $PathValue $true
380
416
  $identity = Open-HelloLynkIdentity $PathValue $true
381
417
  $identity.Handle.Dispose()
@@ -386,14 +422,14 @@ function Resolve-HelloLynkClientRoot([string]$RootValue, [bool]$Create) {
386
422
  Assert-HelloLynkNoReparseAncestors $root
387
423
  $mutex = Enter-HelloLynkRootMutex $root
388
424
  try {
389
- Assert-HelloLynkTrustedAncestorAcl $root
390
- if ($Create) { Ensure-HelloLynkSecureDirectory $root }
425
+ $existingAncestor = Assert-HelloLynkTrustedAncestorAcl $root $Create
426
+ if ($Create) { Ensure-HelloLynkSecureDirectory $root $existingAncestor }
391
427
  if (-not [IO.Directory]::Exists($root)) { Fail "client_root_missing" }
392
428
  Assert-HelloLynkNoReparseAncestors $root
393
429
  Assert-HelloLynkSecureAcl $root $true
394
430
  $identity = Open-HelloLynkIdentity $root $true
395
431
  try {
396
- Assert-HelloLynkTrustedAncestorAcl $root
432
+ $null = Assert-HelloLynkTrustedAncestorAcl $root
397
433
  $canonical = $root
398
434
  } finally { $identity.Handle.Dispose() }
399
435
  return [pscustomobject]@{ Root = $canonical; Mutex = $mutex }
@@ -8,6 +8,7 @@ import { launchPinnedNeutralHostBootstrap, verifyPinnedNeutralHostRuntime } from
8
8
  import { resolveClientAccountRoot } from "../runtime/core/hellolynk-client-account.mjs";
9
9
  import { startInstalledClientUpdate } from "../runtime/core/hellolynk-client-update-entry.mjs";
10
10
  import { recordCodexReleaseProcess } from "../runtime/core/hellolynk-release-retention.mjs";
11
+ import { DARWIN_VAULT_FILE } from "../runtime/core/hellolynk-darwin-vault.mjs";
11
12
 
12
13
  const MODULE_DIR = path.dirname(fileURLToPath(import.meta.url));
13
14
  const PLUGIN_ROOT = path.dirname(MODULE_DIR);
@@ -19,17 +20,22 @@ const MAX_DISCOVERY_WAIT_MS = 120_000;
19
20
  let installedPrepare = null;
20
21
  const TRUSTED_BOOTSTRAP_FILES = Object.freeze(new Map([
21
22
  ["runtime/bootstrap/core/hellolynk-local-process-lock.mjs", "5212990a98b9ad2eb83fa2d5fb8a123d687c5ef6daf6cba49a4b6d04a7fe251e"],
22
- ["runtime/bootstrap/core/hellolynk-client-account.mjs", "ab7ec5dda92e510e7deb14f900fd2df4c6c3373fbeb4af4fb2b6c1a72aa41a99"],
23
- ["runtime/neutral-host-release-loader.mjs", "15593e237fd5cbd765b65e60efe7a1c87e24a5390ad932c8a23d2c03b8da9770"],
23
+ ["runtime/bootstrap/core/hellolynk-client-account.mjs", "6e03a05127d4dc86be6391567b51a956d1a987acf4e23f5699ce0e00c3187b7e"],
24
+ ["runtime/neutral-host-release-loader.mjs", "283a20c6a9b90481bc03c143ab51d5289abf7b7a86fbe51fba7ea2ae1e6d2c60"],
24
25
  ["runtime/neutral-host-bootstrap.mjs", "53513deed7f0155a6603a1489d1609fae37776442358181ff7650d0cd9351f0a"],
25
26
  ["runtime/bootstrap/core/hellolynk-runtime-safety.cjs", "43d576d9f774409f4a735793c1503a6f397e787b10c59a4ac9cc9257299f5efe"],
26
- ["runtime/bootstrap/core/hellolynk-host-protected-store.mjs", "89b6e6c4ce9c6ba2984f8c301de4251da6004bdd402cc44d578a4505c21b75b1"],
27
- ["runtime/bootstrap/core/hellolynk-neutral-host-installation-store.mjs", "dfb6bba4c627082cd6fca8cb38dc786f905e38f3e83ccf91dbfe57e55639e8a2"],
27
+ ["runtime/bootstrap/core/hellolynk-darwin-host.mjs", "ded97c3bc3dd65ca75305f5199a1340dffb987a5f283454d60586df8b6b55c09"],
28
+ ["runtime/bootstrap/core/hellolynk-darwin-vault.mjs", "b6094d856af016e674e4a0183a4e474397bbe92e66638743fa62fe085b554d30"],
29
+ ["runtime/bootstrap/core/hellolynk-host-protected-store.mjs", "10f81f4f6a5dd2fe9a742e847b2eb47dbf20f802f4414f46a05ccbc3505148e2"],
30
+ ["runtime/bootstrap/core/hellolynk-neutral-host-installation-store.mjs", "42ae1e7deb876a8308b7bfed6a7b891d1834117b62504fc5befe3f91a0b4c740"],
28
31
  ["runtime/bootstrap/core/hellolynk-host-auth.mjs", "db1ec56f4e60e6450fba50188eecf89748f39f5d7a75c2456c30a6053233555d"],
29
32
  ["runtime/bootstrap/core/hellolynk-client-profile.mjs", "8be37831c96610e3d0a64848ada86488970cc6079e49764b47d8a8b2ba852269"],
30
- ["runtime/bootstrap/core/hellolynk-platform-credential-store.mjs", "f27f5f377cc4d6d2b5664212cf8fcc4c98d910064c1677ff9c1f776df1a59dba"],
33
+ ["runtime/bootstrap/core/hellolynk-platform-credential-store.mjs", "3969708bafefc3b267bb34a9dcc115804c874ad14f4a036426d727c02ff70d42"],
31
34
  ["runtime/bootstrap/core/hellolynk-client-core.mjs", "94bbad1d0ccee969bbffed176449e427188f1b892512a64167ab31f63d258e2b"],
32
35
  ["runtime/bootstrap/platform/windows/hellolynk-host-protected-store.ps1", "24357e8ce54090b4ec68e457f02c9e834a80f3273ef3c03a8c0fa7258797fb49"],
36
+ ...(process.platform === "darwin" ? [
37
+ ["runtime/bootstrap/platform/darwin/hellolynk-keychain-helper.bin", "0000000000000000000000000000000000000000000000000000000000000000"],
38
+ ] : []),
33
39
  ]));
34
40
 
35
41
  // A still-open cache may load a different installed release during an update.
@@ -150,7 +156,7 @@ export async function prepareCodexNeutralRelease(options = {}, finalBindingDefer
150
156
  releaseRoot: bootstrapReleaseRoot,
151
157
  });
152
158
  const storeRoot = resolveClientAccountRoot("codex", absolutePath(
153
- options.storeRoot || env.HELLOLYNK_NEUTRAL_STORE_ROOT || bootstrapTrusted.defaultStoreRoot("win32", env),
159
+ options.storeRoot || env.HELLOLYNK_NEUTRAL_STORE_ROOT || bootstrapTrusted.defaultStoreRoot(process.platform, env),
154
160
  "neutral_codex_binding_configuration_required",
155
161
  ));
156
162
  const bootstrapInstallationStore = bootstrapTrusted.createInstallationStore({ root: storeRoot });
@@ -198,7 +204,7 @@ async function prepareSelectedRelease(options, verifiedInitial = null) {
198
204
  const releaseRoot = path.dirname(path.dirname(loaderPath));
199
205
  const trusted = await loadTrustedBootstrap({ loaderPath, releaseRoot });
200
206
  const storeRoot = resolveClientAccountRoot("codex", absolutePath(
201
- options.storeRoot || env.HELLOLYNK_NEUTRAL_STORE_ROOT || trusted.defaultStoreRoot("win32", env),
207
+ options.storeRoot || env.HELLOLYNK_NEUTRAL_STORE_ROOT || trusted.defaultStoreRoot(process.platform, env),
202
208
  "neutral_codex_binding_configuration_required",
203
209
  ));
204
210
  const installationStore = trusted.createInstallationStore({ root: storeRoot });
@@ -268,7 +274,7 @@ async function initializationFingerprint(storeRoot, binding = null) {
268
274
  if (parent === path.dirname(parent)) break;
269
275
  }
270
276
  };
271
- await stat(path.join(storeRoot, "capabilities-v1.dpapi.clixml"), false);
277
+ await stat(path.join(storeRoot, process.platform === "darwin" ? DARWIN_VAULT_FILE : "capabilities-v1.dpapi.clixml"), false);
272
278
  await stat(path.join(storeRoot, "installations-v1.json"), false);
273
279
  const state = JSON.stringify([...seen]);
274
280
  if (binding) {
@@ -5,6 +5,7 @@ import crypto from "node:crypto";
5
5
  import fs from "node:fs/promises";
6
6
  import path from "node:path";
7
7
 
8
+ import { verifyDarwinUnclaimedAuthorization } from "../plugins/hellolynk-codex/runtime/core/hellolynk-darwin-host.mjs";
8
9
  import { readClientProfile } from "../plugins/hellolynk-codex/runtime/core/hellolynk-client-profile.mjs";
9
10
  import { createNeutralHostInstallationStore } from "../plugins/hellolynk-codex/runtime/core/hellolynk-neutral-host-installation-store.mjs";
10
11
  import { clientAccountBaseRoot } from "../plugins/hellolynk-codex/runtime/core/hellolynk-client-account.mjs";
@@ -164,7 +165,7 @@ assert.equal(releaseVerification.verifiedFileCount >= 8, true);
164
165
  let transport = null;
165
166
  let bootstrapTransportRequired = false;
166
167
  let protectedStorePresent = true;
167
- try { await fs.lstat(path.join(root, "capabilities-v1.dpapi.clixml")); }
168
+ try { await fs.lstat(path.join(root, process.platform === "darwin" ? "protected-v1.sqlite" : "capabilities-v1.dpapi.clixml")); }
168
169
  catch (error) {
169
170
  if (error?.code !== "ENOENT") throw error;
170
171
  protectedStorePresent = false;
@@ -173,6 +174,9 @@ if (!protectedStorePresent) {
173
174
  if (!(freshPreBind || recoveryPreBind)) await store.status();
174
175
  await verifyHostProtectedStorePath({ root, path: root, directory: true });
175
176
  bootstrapTransportRequired = true;
177
+ } else if (process.platform === "darwin" && freshPreBind) {
178
+ await verifyDarwinUnclaimedAuthorization(root);
179
+ bootstrapTransportRequired = true;
176
180
  } else {
177
181
  assert.equal((await store.status()).protected, true);
178
182
  try { transport = preflightOnly ? await store.verifyTransport() : await store.resolveTransport(); }