@verax-ai/body 0.4.1 → 0.4.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/dist/install.d.ts CHANGED
@@ -39,6 +39,7 @@ export declare function readWindowsMachineRoots(exec?: ToolExec): WindowsMachine
39
39
  * Absolute path for a system tool. Windows uses System32 under SystemRoot.
40
40
  * Linux walks fixed directories and never consults PATH.
41
41
  * macOS uses the fixed table (dscl, launchctl, chown, chmod, id, stat, plutil, lsof).
42
+ * `ls` is the POSIX ACL reader at `/bin/ls`, not an install-plan tool, so it is not in that table.
42
43
  * A missing Linux binary falls back to the first candidate so a plan can name
43
44
  * the path; spawning still refuses when that file is absent.
44
45
  */
@@ -393,6 +394,9 @@ export declare function windowsSddlBatchStdin(paths: readonly string[]): string;
393
394
  * object: `{ "<path>": "<sddl>" | { "error": "<msg>" } }`.
394
395
  * PowerShell 5.1 unwraps a one-element JSON array, so the script re-wraps with
395
396
  * `| ForEach-Object { $_ }`.
397
+ * JSON cmdlets are loaded with psModuleImports before first use. #119, measured
398
+ * on windows-full 5a75875: autoload of ConvertFrom-Json took 23 to 30 s on a
399
+ * GitHub Windows runner, and 0.27 s once the module was loaded from System32 first.
396
400
  */
397
401
  export declare function windowsSddlBatchArgv(paths: readonly string[]): string[];
398
402
  export type SddlHit = {
@@ -474,12 +478,32 @@ export declare function posixOthersCanReplace(st: {
474
478
  mode: number;
475
479
  symlink?: boolean;
476
480
  }, ancestor: boolean): boolean;
477
- /** POSIX half of the elevated code check. `read` supplies uid and mode so a test does not lstat the machine. */
481
+ /**
482
+ * Text for a POSIX ACL refusal, or null when the extended ACL adds no writer.
483
+ * `"unreadable"` is fail-closed: Linux showed `+` and `getfacl` did not return the entries.
484
+ * The phrase is what the operator sees: install acl or remove the ACL.
485
+ */
486
+ export declare function posixAclWriterDetail(found: readonly string[] | "unreadable" | undefined): string | null;
487
+ /**
488
+ * Extended ACL writers for every path, from one `ls` (and on Linux one `getfacl` for the `+` paths).
489
+ * macOS: `allow` entries with a write right, except the file owner, `user:root`, and `group:admin`.
490
+ * `deny` is ignored. `inherited` still counts.
491
+ * Linux: a named `user:` or `group:` with `w` that the `mask` also allows.
492
+ * `getfacl` missing while `ls` shows `+` is `"unreadable"` (fail closed).
493
+ * A non-zero `ls` is `"unreadable"` too: the `+` could not be seen.
494
+ * Exit 0 with no `+` is an empty list.
495
+ */
496
+ export declare function posixAclWriters(paths: readonly string[], platform: NodeJS.Platform, exec: ToolExec): Map<string, string[] | "unreadable">;
497
+ /**
498
+ * POSIX half of the elevated code check. `read` supplies uid and mode so a test does not lstat the machine.
499
+ * `acls` is the one `posixAclWriters` map for this trust list. When mode says the entry is safe, a writer
500
+ * or `"unreadable"` is still a refusal. Omit `acls` only when the caller is injecting modes and not ACLs.
501
+ */
478
502
  export declare function posixCodeDirectoryDetail(dir: string, platform: InstallPlatform, read: (file: string) => {
479
503
  uid: number;
480
504
  mode: number;
481
505
  symlink?: boolean;
482
- } | null): string | false;
506
+ } | null, acls?: ReadonlyMap<string, string[] | "unreadable">): string | false;
483
507
  /**
484
508
  * Directory grant only. `(OI)(CI)` on a directory propagates to children.
485
509
  * Never combine this with `/T`: `/inheritance:r /T` strips every child, and `(OI)(CI)`
@@ -511,6 +535,18 @@ export declare function normalizeLogonHolders(csv: string, nameToSid: Readonly<R
511
535
  export declare function logonHolderMismatchLines(previous: readonly string[], expected: readonly string[], after: readonly string[]): string[];
512
536
  /** Terminating errors exit 1. Native calls still need an explicit `$LASTEXITCODE` check. */
513
537
  export declare function powerShellScript(body: string): string;
538
+ export type WindowsPowerShellScript = {
539
+ id: string;
540
+ script: string;
541
+ };
542
+ /**
543
+ * Every PowerShell -Command install.ts runs, with sample paths.
544
+ * Call sites: readWindowsMachineRoots, windowsSddlArgv, windowsSddlBatchArgv,
545
+ * powershellStdin (account create, account update, scheduled task), ownerModeLine,
546
+ * the service SID lookup in execute, directoryOwnerSid, the ProfileImagePath lookup,
547
+ * and windowsServiceSid. desktop.ts local account SIDs are a separate command.
548
+ */
549
+ export declare function windowsPowerShellScripts(): WindowsPowerShellScript[];
514
550
  export declare function successText(platform: InstallPlatform, info: {
515
551
  codeDir: string;
516
552
  stateDir: string;