@homeflare/alchemy 0.23.0 → 0.25.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.
Files changed (177) hide show
  1. package/README.md +25 -1
  2. package/dist/litellm/client.d.ts +76 -0
  3. package/dist/litellm/client.d.ts.map +1 -0
  4. package/dist/litellm/credentials.d.ts +48 -0
  5. package/dist/litellm/credentials.d.ts.map +1 -0
  6. package/dist/litellm/fake-litellm.d.ts +36 -0
  7. package/dist/litellm/fake-litellm.d.ts.map +1 -0
  8. package/dist/litellm/fake-stack.d.ts +30 -0
  9. package/dist/litellm/fake-stack.d.ts.map +1 -0
  10. package/dist/litellm/generated/pass-through.d.ts +71 -0
  11. package/dist/litellm/generated/pass-through.d.ts.map +1 -0
  12. package/dist/litellm/index.d.ts +13 -0
  13. package/dist/litellm/index.d.ts.map +1 -0
  14. package/dist/litellm/index.js +270 -0
  15. package/dist/litellm/index.js.map +14 -0
  16. package/dist/litellm/pass-through-endpoint.d.ts +94 -0
  17. package/dist/litellm/pass-through-endpoint.d.ts.map +1 -0
  18. package/dist/litellm/pass-through-form.d.ts +40 -0
  19. package/dist/litellm/pass-through-form.d.ts.map +1 -0
  20. package/dist/litellm/providers.d.ts +16 -0
  21. package/dist/litellm/providers.d.ts.map +1 -0
  22. package/dist/paperless/client.d.ts +37 -0
  23. package/dist/paperless/client.d.ts.map +1 -0
  24. package/dist/paperless/constraint-guard.d.ts +19 -0
  25. package/dist/paperless/constraint-guard.d.ts.map +1 -0
  26. package/dist/paperless/constraints.d.ts +50 -0
  27. package/dist/paperless/constraints.d.ts.map +1 -0
  28. package/dist/paperless/credentials.d.ts +40 -0
  29. package/dist/paperless/credentials.d.ts.map +1 -0
  30. package/dist/paperless/custom-field.d.ts +75 -0
  31. package/dist/paperless/custom-field.d.ts.map +1 -0
  32. package/dist/paperless/document-type.d.ts +30 -0
  33. package/dist/paperless/document-type.d.ts.map +1 -0
  34. package/dist/paperless/errors.d.ts +49 -0
  35. package/dist/paperless/errors.d.ts.map +1 -0
  36. package/dist/paperless/fake-paperless.d.ts +39 -0
  37. package/dist/paperless/fake-paperless.d.ts.map +1 -0
  38. package/dist/paperless/generated/constraints/index.d.ts +13 -0
  39. package/dist/paperless/generated/constraints/index.d.ts.map +1 -0
  40. package/dist/paperless/generated/constraints/paperless-custom_fields.d.ts +21 -0
  41. package/dist/paperless/generated/constraints/paperless-custom_fields.d.ts.map +1 -0
  42. package/dist/paperless/generated/constraints/paperless-document_types.d.ts +21 -0
  43. package/dist/paperless/generated/constraints/paperless-document_types.d.ts.map +1 -0
  44. package/dist/paperless/generated/constraints/paperless-storage_paths.d.ts +21 -0
  45. package/dist/paperless/generated/constraints/paperless-storage_paths.d.ts.map +1 -0
  46. package/dist/paperless/generated/constraints/paperless-tags.d.ts +21 -0
  47. package/dist/paperless/generated/constraints/paperless-tags.d.ts.map +1 -0
  48. package/dist/paperless/generated/types/custom-fields.d.ts +23 -0
  49. package/dist/paperless/generated/types/custom-fields.d.ts.map +1 -0
  50. package/dist/paperless/generated/types/document-types.d.ts +39 -0
  51. package/dist/paperless/generated/types/document-types.d.ts.map +1 -0
  52. package/dist/paperless/generated/types/index.d.ts +10 -0
  53. package/dist/paperless/generated/types/index.d.ts.map +1 -0
  54. package/dist/paperless/generated/types/storage-paths.d.ts +31 -0
  55. package/dist/paperless/generated/types/storage-paths.d.ts.map +1 -0
  56. package/dist/paperless/generated/types/tags.d.ts +37 -0
  57. package/dist/paperless/generated/types/tags.d.ts.map +1 -0
  58. package/dist/paperless/index.d.ts +19 -0
  59. package/dist/paperless/index.d.ts.map +1 -0
  60. package/dist/paperless/index.js +524 -0
  61. package/dist/paperless/index.js.map +26 -0
  62. package/dist/paperless/matching-locate.d.ts +33 -0
  63. package/dist/paperless/matching-locate.d.ts.map +1 -0
  64. package/dist/paperless/matching-types.d.ts +60 -0
  65. package/dist/paperless/matching-types.d.ts.map +1 -0
  66. package/dist/paperless/matching.d.ts +61 -0
  67. package/dist/paperless/matching.d.ts.map +1 -0
  68. package/dist/paperless/providers.d.ts +15 -0
  69. package/dist/paperless/providers.d.ts.map +1 -0
  70. package/dist/paperless/storage-path.d.ts +32 -0
  71. package/dist/paperless/storage-path.d.ts.map +1 -0
  72. package/dist/paperless/tag.d.ts +47 -0
  73. package/dist/paperless/tag.d.ts.map +1 -0
  74. package/dist/postgres/connection.d.ts +50 -0
  75. package/dist/postgres/connection.d.ts.map +1 -0
  76. package/dist/postgres/database-attrs.d.ts +79 -0
  77. package/dist/postgres/database-attrs.d.ts.map +1 -0
  78. package/dist/postgres/database-sql.d.ts +73 -0
  79. package/dist/postgres/database-sql.d.ts.map +1 -0
  80. package/dist/postgres/database.d.ts +63 -0
  81. package/dist/postgres/database.d.ts.map +1 -0
  82. package/dist/postgres/errors.d.ts +86 -0
  83. package/dist/postgres/errors.d.ts.map +1 -0
  84. package/dist/postgres/fake-sql.d.ts +22 -0
  85. package/dist/postgres/fake-sql.d.ts.map +1 -0
  86. package/dist/postgres/index.d.ts +16 -0
  87. package/dist/postgres/index.d.ts.map +1 -0
  88. package/dist/postgres/index.js +238 -0
  89. package/dist/postgres/index.js.map +15 -0
  90. package/dist/postgres/providers.d.ts +14 -0
  91. package/dist/postgres/providers.d.ts.map +1 -0
  92. package/dist/proxmox/index.js.map +2 -2
  93. package/dist/proxmox/zfs-pool.d.ts +10 -2
  94. package/dist/proxmox/zfs-pool.d.ts.map +1 -1
  95. package/dist/release/archive.d.ts +6 -2
  96. package/dist/release/archive.d.ts.map +1 -1
  97. package/dist/release/binary-form.d.ts +14 -9
  98. package/dist/release/binary-form.d.ts.map +1 -1
  99. package/dist/release/binary-pins.d.ts +17 -0
  100. package/dist/release/binary-pins.d.ts.map +1 -0
  101. package/dist/release/catalog.d.ts.map +1 -1
  102. package/dist/release/index.js +90 -40
  103. package/dist/release/index.js.map +8 -7
  104. package/dist/release/tar.d.ts +9 -2
  105. package/dist/release/tar.d.ts.map +1 -1
  106. package/docs/litellm.md +110 -0
  107. package/docs/paperless.md +115 -0
  108. package/docs/peers.md +8 -1
  109. package/docs/postgres.md +125 -0
  110. package/docs/release-binary-catalogs.md +40 -4
  111. package/docs/release-binary-refusals.md +22 -8
  112. package/docs/release-binary-upstream.md +33 -15
  113. package/package.json +14 -1
  114. package/src/litellm/client.ts +195 -0
  115. package/src/litellm/credentials.ts +73 -0
  116. package/src/litellm/fake-litellm.ts +114 -0
  117. package/src/litellm/fake-stack.ts +100 -0
  118. package/src/litellm/generated/pass-through.ts +73 -0
  119. package/src/litellm/index.ts +42 -0
  120. package/src/litellm/pass-through-endpoint-delete-swallow.test.ts +66 -0
  121. package/src/litellm/pass-through-endpoint-replace.test.ts +84 -0
  122. package/src/litellm/pass-through-endpoint.test.ts +208 -0
  123. package/src/litellm/pass-through-endpoint.ts +258 -0
  124. package/src/litellm/pass-through-form.test.ts +128 -0
  125. package/src/litellm/pass-through-form.ts +136 -0
  126. package/src/litellm/providers.ts +19 -0
  127. package/src/paperless/client.ts +88 -0
  128. package/src/paperless/constraint-guard.ts +50 -0
  129. package/src/paperless/constraints.test.ts +74 -0
  130. package/src/paperless/constraints.ts +111 -0
  131. package/src/paperless/credentials.ts +69 -0
  132. package/src/paperless/custom-field.test.ts +74 -0
  133. package/src/paperless/custom-field.ts +95 -0
  134. package/src/paperless/document-type.ts +74 -0
  135. package/src/paperless/errors.ts +62 -0
  136. package/src/paperless/fake-paperless.ts +156 -0
  137. package/src/paperless/generated/constraints/index.ts +23 -0
  138. package/src/paperless/generated/constraints/paperless-custom_fields.ts +29 -0
  139. package/src/paperless/generated/constraints/paperless-document_types.ts +32 -0
  140. package/src/paperless/generated/constraints/paperless-storage_paths.ts +34 -0
  141. package/src/paperless/generated/constraints/paperless-tags.ts +34 -0
  142. package/src/paperless/generated/types/custom-fields.ts +23 -0
  143. package/src/paperless/generated/types/document-types.ts +30 -0
  144. package/src/paperless/generated/types/index.ts +9 -0
  145. package/src/paperless/generated/types/storage-paths.ts +31 -0
  146. package/src/paperless/generated/types/tags.ts +37 -0
  147. package/src/paperless/index.ts +56 -0
  148. package/src/paperless/matching-identity.test.ts +194 -0
  149. package/src/paperless/matching-locate.ts +104 -0
  150. package/src/paperless/matching-types.ts +61 -0
  151. package/src/paperless/matching.test.ts +128 -0
  152. package/src/paperless/matching.ts +239 -0
  153. package/src/paperless/providers.ts +27 -0
  154. package/src/paperless/storage-path.ts +78 -0
  155. package/src/paperless/tag.ts +91 -0
  156. package/src/postgres/connection.ts +62 -0
  157. package/src/postgres/database-attrs.ts +87 -0
  158. package/src/postgres/database-bigint-serialization.test.ts +140 -0
  159. package/src/postgres/database-lifecycle.test.ts +113 -0
  160. package/src/postgres/database-provenance.test.ts +118 -0
  161. package/src/postgres/database-refusals.test.ts +135 -0
  162. package/src/postgres/database-sql.ts +174 -0
  163. package/src/postgres/database.ts +193 -0
  164. package/src/postgres/errors.ts +131 -0
  165. package/src/postgres/fake-sql.ts +123 -0
  166. package/src/postgres/fixtures/pg-REL_18_6-create-database-synopsis.txt +26 -0
  167. package/src/postgres/fixtures/pg-REL_18_6-pg_database.h.txt +67 -0
  168. package/src/postgres/index.ts +30 -0
  169. package/src/postgres/providers.ts +16 -0
  170. package/src/proxmox/zfs-pool.ts +10 -2
  171. package/src/release/archive.ts +10 -4
  172. package/src/release/binary-form.ts +24 -76
  173. package/src/release/binary-pins.ts +95 -0
  174. package/src/release/binary-root.test.ts +122 -0
  175. package/src/release/catalog.ts +10 -2
  176. package/src/release/tar-root.test.ts +114 -0
  177. package/src/release/tar.ts +78 -12
@@ -54,8 +54,16 @@
54
54
  *
55
55
  * ⚠️ PRIVILEGES, FROM THE SCHEMA. Read and diff need `Sys.Audit` on `/` — both GETs check it.
56
56
  * Reconcile needs `Sys.Modify` on `/` for the POST. `Datastore.Allocate` on `/storage` is NOT
57
- * needed, because `add_storage` is not offered — see the ⛔ on `ZfsPoolProps`. `delete` needs
58
- * nothing at all, since it calls nothing.
57
+ * needed, because `add_storage` is not offered — see the ⛔ on `ZfsPoolProps`.
58
+ * ★ CORRECTED 2026-09-23, ALONGSIDE THE HEADER ABOVE: `delete` needs `Sys.Modify` on `/` too,
59
+ * for the DELETE it now sends under `.pipe(RemovalPolicy.destroy())` — the whole `disks/zfs`
60
+ * family checks it, not only the POST. MEASURED the same day as the rest of this paragraph:
61
+ * `ceph-osd.ts`'s own privilege comparison names `disks/zfs` as one of the sibling families
62
+ * whose write verbs DO carry a `Sys.Modify` check, unlike `ceph/osd`'s create and delete, which
63
+ * carry no permissions block at all and 403 for any identity but `root@pam`. This line
64
+ * previously said delete "needs nothing at all, since it calls nothing", which repeated the same
65
+ * mistake the header above corrects: `delete` calls the DELETE endpoint, so it needs whatever
66
+ * that endpoint checks.
59
67
  */
60
68
  import { Resource } from 'alchemy';
61
69
  import * as Provider from 'alchemy/Provider';
@@ -1 +1 @@
1
- {"version":3,"file":"zfs-pool.d.ts","sourceRoot":"","sources":["../../src/proxmox/zfs-pool.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA0DG;AACH,OAAO,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC;AACnC,OAAO,KAAK,QAAQ,MAAM,kBAAkB,CAAC;AAE7C,OAAO,KAAK,EAAE,2BAA2B,EAAE,MAAM,oBAAoB,CAAC;AACtE,OAAO,EAAE,KAAK,eAAe,EAAE,KAAK,UAAU,EAA8B,MAAM,eAAe,CAAC;AAIlG;;;;;;;GAOG;AACH,MAAM,MAAM,YAAY,GAAG,WAAW,CAAC,2BAA2B,CAAC,WAAW,CAAC,CAAC,CAAC;AAEjF,iFAAiF;AACjF,MAAM,MAAM,cAAc,GAAG,WAAW,CAAC,2BAA2B,CAAC,aAAa,CAAC,CAAC,CAAC;AAErF;;;;;;;;GAQG;AACH,MAAM,WAAW,YAAa,SAAQ,UAAU;IAC9C;;;;;OAKG;IACH,IAAI,EAAE,MAAM,CAAC;IACb,+FAA+F;IAC/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,CAAC,2BAA2B,CAAC,WAAW,CAAC,CAAC,CAAC;AAEjF,iFAAiF;AACjF,MAAM,MAAM,cAAc,GAAG,WAAW,CAAC,2BAA2B,CAAC,aAAa,CAAC,CAAC,CAAC;AAErF;;;;;;;;GAQG;AACH,MAAM,WAAW,YAAa,SAAQ,UAAU;IAC9C;;;;;OAKG;IACH,IAAI,EAAE,MAAM,CAAC;IACb,+FAA+F;IAC/F,IAAI,EAAE,MAAM,CAAC;IACb;;;;;;;;;;;;;;;;;;;;;;OAsBG;IACH,OAAO,CAAC,EAAE,SAAS,MAAM,EAAE,CAAC;IAC5B,SAAS,CAAC,EAAE,YAAY,CAAC;IACzB;;;;;;;OAOG;IACH,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB;;;OAGG;IACH,WAAW,CAAC,EAAE,cAAc,CAAC;IAC7B;;;;OAIG;IACH,cAAc,CAAC,EAAE,MAAM,CAAC;CACzB;AAED;;;;GAIG;AACH,MAAM,WAAW,iBAAiB;IAChC,mFAAmF;IACnF,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;IACb,uEAAuE;IACvE,KAAK,EAAE,MAAM,CAAC;IACd,4DAA4D;IAC5D,MAAM,EAAE,MAAM,CAAC;IACf;;;;;;;OAOG;IACH,OAAO,EAAE,MAAM,CAAC;CACjB;AAED,MAAM,WAAW,cAAe,SAAQ,QAAQ,CAC9C,iBAAiB,EACjB,YAAY,EACZ,iBAAiB,EACjB,KAAK,EACL,eAAe,CAChB;CAAG;AAEJ,mGAAmG;AACnG,eAAO,MAAM,cAAc,iDAEzB,CAAC;AAqBH,eAAO,MAAM,sBAAsB,oIACoD,CAAC"}
@@ -1,7 +1,11 @@
1
1
  import type { PinnedDownload } from './binary-form.ts';
2
2
  import { type TarContents } from './tar.ts';
3
- /** Gunzip and read a tar, keeping only `wanted`. Throws ArchiveRefused. */
4
- export declare const extractMembers: (gzipped: Uint8Array, wanted: ReadonlySet<string>) => Promise<TarContents>;
3
+ /**
4
+ * Gunzip and read a tar, keeping only `wanted`. Throws ArchiveRefused.
5
+ * @param root The one declared leading directory to strip (tar.ts) — a directory-wrapped vendor
6
+ * archive (the Prometheus family, measured 2026-09-23) without it, or one that carries no root.
7
+ */
8
+ export declare const extractMembers: (gzipped: Uint8Array, wanted: ReadonlySet<string>, root?: string) => Promise<TarContents>;
5
9
  /**
6
10
  * The declared member's bytes out of a downloaded archive, both layers checked.
7
11
  * ⚠️ `archive` may be shared with another resource's extraction (download.ts sharingInFlight):
@@ -1 +1 @@
1
- {"version":3,"file":"archive.d.ts","sourceRoot":"","sources":["../../src/release/archive.ts"],"names":[],"mappings":"AAmBA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAEvD,OAAO,EAAE,KAAK,WAAW,EAAa,MAAM,UAAU,CAAC;AAKvD,2EAA2E;AAC3E,eAAO,MAAM,cAAc,YAChB,UAAU,UACX,WAAW,CAAC,MAAM,CAAC,KAC1B,OAAO,CAAC,WAAW,CA8BrB,CAAC;AAUF;;;;GAIG;AACH,eAAO,MAAM,cAAc,YAChB,UAAU,WACV,cAAc,KACtB,OAAO,CAAC,UAAU,CAepB,CAAC"}
1
+ {"version":3,"file":"archive.d.ts","sourceRoot":"","sources":["../../src/release/archive.ts"],"names":[],"mappings":"AAmBA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAEvD,OAAO,EAAE,KAAK,WAAW,EAAa,MAAM,UAAU,CAAC;AAKvD;;;;GAIG;AACH,eAAO,MAAM,cAAc,YAChB,UAAU,UACX,WAAW,CAAC,MAAM,CAAC,SACpB,MAAM,KACZ,OAAO,CAAC,WAAW,CA8BrB,CAAC;AAUF;;;;GAIG;AACH,eAAO,MAAM,cAAc,YAChB,UAAU,WACV,cAAc,KACtB,OAAO,CAAC,UAAU,CAgBpB,CAAC"}
@@ -28,6 +28,17 @@ export interface ReleaseArchive {
28
28
  readonly size: number;
29
29
  /** The archive's SHA-256, lower-case hex, as the vendor's checksum file lists it. */
30
30
  readonly sha256: string;
31
+ /**
32
+ * The one directory the vendor wraps every entry in, exactly as its own archive names it —
33
+ * `'alertmanager-0.33.1.darwin-arm64'`, never `'alertmanager-0.33.1.darwin-arm64/'` (no trailing
34
+ * slash). Pinned from the walk-down, never derived from `asset` or `tag`: the vendor spells its
35
+ * wrapper however it likes (`darwin_arm64`, an `-enterprise` suffix, no version at all), so a
36
+ * computed name would drift onto a sibling the moment one vendor's naming changes. Omit it for a
37
+ * flat archive (Victoria, OpenBao); the tar reader then refuses a directory entry exactly as it
38
+ * always has (tar.ts).
39
+ * @default undefined — no wrapping directory; the archive is flat.
40
+ */
41
+ readonly root?: string;
31
42
  }
32
43
  export interface ReleaseBinaryProps {
33
44
  /** The pinned archive the binary comes out of. `catalogBinary()` fills it from a data set. */
@@ -77,6 +88,8 @@ export type PinnedDownload = {
77
88
  readonly member: string;
78
89
  /** The member's pinned SHA-256. */
79
90
  readonly memberSha256: string;
91
+ /** The one declared leading directory to strip, if the archive has one — `archive.root`. */
92
+ readonly root?: string;
80
93
  };
81
94
  export declare const DEFAULT_BINARY_MODE = 493;
82
95
  /**
@@ -95,14 +108,7 @@ export declare const releaseBinaryPath: (props: {
95
108
  /** The download a declaration means. ⚠️ Validate first (binaryProblems): this trusts its input. */
96
109
  export declare const pinnedDownload: (props: ReleaseBinaryProps) => PinnedDownload;
97
110
  export declare const modeProblems: (mode: number) => string[];
98
- export declare const MAX_ARCHIVE: number;
99
- /** Everything wrong with the pins alone — plain strings in any declaration, resolved or not. */
100
- export declare const pinProblems: (props: {
101
- readonly archive?: Partial<ReleaseArchive>;
102
- readonly member?: unknown;
103
- readonly sha256?: unknown;
104
- readonly name?: unknown;
105
- }) => string[];
111
+ export { MAX_ARCHIVE, pinProblems } from './binary-pins.ts';
106
112
  type Pins = Pick<ReleaseBinaryProps, 'archive' | 'member' | 'sha256'>;
107
113
  /** Whether two declarations pin different bytes: another archive, member or member digest. */
108
114
  export declare const pinsMoved: (olds: Pins, news: Pins) => boolean;
@@ -114,5 +120,4 @@ export declare const pinsMoved: (olds: Pins, news: Pins) => boolean;
114
120
  export declare const inPlaceRefusal: (olds: Pins, news: Pins) => string;
115
121
  /** Everything wrong with a declaration, before any host or network is asked anything. */
116
122
  export declare const binaryProblems: (props: ReleaseBinaryProps) => string[];
117
- export {};
118
123
  //# sourceMappingURL=binary-form.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"binary-form.d.ts","sourceRoot":"","sources":["../../src/release/binary-form.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AACH,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,8BAA8B,CAAC;AAGvE,oFAAoF;AACpF,MAAM,WAAW,cAAc;IAC7B,kGAAkG;IAClG,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,2DAA2D;IAC3D,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAC;IACrB;;;OAGG;IACH,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,yFAAyF;IACzF,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,qFAAqF;IACrF,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;CACzB;AAED,MAAM,WAAW,kBAAkB;IACjC,8FAA8F;IAC9F,OAAO,EAAE,cAAc,CAAC;IACxB,oGAAoG;IACpG,MAAM,EAAE,MAAM,CAAC;IACf,uEAAuE;IACvE,MAAM,EAAE,MAAM,CAAC;IACf;;;OAGG;IACH,IAAI,EAAE,MAAM,CAAC;IACb;;;;;;OAMG;IACH,SAAS,EAAE,MAAM,CAAC;IAClB;;;;;OAKG;IACH,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,uEAAuE;IACvE,KAAK,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IACxB,yEAAyE;IACzE,KAAK,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;CACzB;AAED,MAAM,WAAW,uBAAwB,SAAQ,kBAAkB;I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G,OAGkB,CAAC;AAEtE;;;;GAIG;AACH,eAAO,MAAM,cAAc,SAAU,IAAI,QAAQ,IAAI,KAAG,MAGqB,CAAC;AAE9E,yFAAyF;AACzF,eAAO,MAAM,cAAc,UAAW,kBAAkB,KAAG,MAAM,EAMhE,CAAC"}
@@ -0,0 +1,17 @@
1
+ /**
2
+ * `pinProblems` — everything wrong with a declaration's pins alone, as plain strings, checked
3
+ * before a plan resolves a directory or a host is asked anything. Split out of binary-form.ts
4
+ * 2026-09-23 to keep that file under the house's 250-line cap (it was 229, heading for ~250 once
5
+ * `archive.root` needed its own validation and JSDoc). binary-form.ts re-exports `pinProblems` and
6
+ * `MAX_ARCHIVE`, so nothing that imported them moves.
7
+ */
8
+ import type { ReleaseArchive } from './binary-form.ts';
9
+ export declare const MAX_ARCHIVE: number;
10
+ /** Everything wrong with the pins alone — plain strings in any declaration, resolved or not. */
11
+ export declare const pinProblems: (props: {
12
+ readonly archive?: Partial<ReleaseArchive>;
13
+ readonly member?: unknown;
14
+ readonly sha256?: unknown;
15
+ readonly name?: unknown;
16
+ }) => string[];
17
+ //# sourceMappingURL=binary-pins.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"binary-pins.d.ts","sourceRoot":"","sources":["../../src/release/binary-pins.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AACH,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAGvD,eAAO,MAAM,WAAW,QAAU,CAAC;AAcnC,gGAAgG;AAChG,eAAO,MAAM,WAAW,UAAW;IACjC,QAAQ,CAAC,OAAO,CAAC,EAAE,OAAO,CAAC,cAAc,CAAC,CAAC;IAC3C,QAAQ,CAAC,MAAM,CAAC,EAAE,OAAO,CAAC;IAC1B,QAAQ,CAAC,MAAM,CAAC,EAAE,OAAO,CAAC;IAC1B,QAAQ,CAAC,IAAI,CAAC,EAAE,OAAO,CAAC;CACzB,KAAG,MAAM,EAgET,CAAC"}
@@ -1 +1 @@
1
- {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jF,eAAO,MAAM,eAAe,YAAa,cAAc,WAAW,cAAc,KAAG,MAAM,EAkDxF,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,aAAa,YAAa,cAAc,WAAW,cAAc,KAAG,YAoChF,CAAC;AAEF,4FAA4F;AAC5F,eAAO,MAAM,gBAAgB,SACrB,MAAM,WACH,IAAI,CAAC,cAAc,EAAE,SAAS,GAAG,SAAS,CAAC,KACnD,MAAyD,CAAC;AAE7D,8EAA8E;AAC9E,MAAM,MAAM,gBAAgB,GAAG,cAAc,GAAG;IAAE,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAA;CAAE,CAAC;AAE5E;;;;;;GAMG;AACH,eAAO,MAAM,cAAc,aACf,SAAS,cAAc,EAAE,UAC3B,MAAM,KACb,gBAAgB,GAAG,SAgBrB,CAAC"}
@@ -71,31 +71,7 @@ var fileProblems = (props) => {
71
71
  return found;
72
72
  };
73
73
 
74
- // src/release/binary-form.ts
75
- var DEFAULT_BINARY_MODE = 493;
76
- var releaseUrl = (repo, tag, asset) => `https://github.com/${repo}/releases/download/${tag}/${asset}`;
77
- var releaseBinaryPath = (props) => `${props.directory}/${props.name}`;
78
- var pinnedDownload = (props) => ({
79
- member: props.member,
80
- memberSha256: props.sha256,
81
- sha256: props.archive.sha256,
82
- size: props.archive.size,
83
- url: releaseUrl(props.archive.repo, props.archive.tag, props.archive.asset)
84
- });
85
- var modeProblems = (mode) => {
86
- if (!Number.isSafeInteger(mode) || mode < 0 || mode > 4095)
87
- return ["mode must be 0–0o7777"];
88
- const found = [];
89
- if ((mode & 3584) !== 0)
90
- found.push("mode must not set setuid, setgid or sticky");
91
- if ((mode & 18) !== 0)
92
- found.push("mode must not be group- or world-writable");
93
- if ((mode & 64) === 0)
94
- found.push("mode must let the owner execute it");
95
- if ((mode & 256) === 0)
96
- found.push("mode must let the owner read it (it is re-hashed)");
97
- return found;
98
- };
74
+ // src/release/binary-pins.ts
99
75
  var HEX64 = /^[0-9a-f]{64}$/;
100
76
  var MAX_ARCHIVE = 1 << 30;
101
77
  var REPO = /^[A-Za-z0-9](?:[A-Za-z0-9-]*[A-Za-z0-9])?\/[A-Za-z0-9._-]+$/;
@@ -132,6 +108,15 @@ var pinProblems = (props) => {
132
108
  else if (!TARBALL.test(asset))
133
109
  found.push(`archive.asset must be a .tar.gz or .tgz: "${asset}"`);
134
110
  }
111
+ if (archive.root !== undefined) {
112
+ if (typeof archive.root !== "string") {
113
+ found.push("archive.root must be a plain string when given");
114
+ } else {
115
+ const problem = segmentProblem("archive.root", archive.root);
116
+ if (problem !== undefined)
117
+ found.push(problem);
118
+ }
119
+ }
135
120
  const size = archive.size;
136
121
  if (typeof size !== "number" || !Number.isSafeInteger(size) || size <= 0 || size > MAX_ARCHIVE) {
137
122
  found.push(`archive.size must be the asset's byte count, 1 to ${String(MAX_ARCHIVE)}`);
@@ -150,7 +135,34 @@ var pinProblems = (props) => {
150
135
  }
151
136
  return found;
152
137
  };
153
- var ARCHIVE_KEYS = ["repo", "tag", "asset", "size", "sha256"];
138
+
139
+ // src/release/binary-form.ts
140
+ var DEFAULT_BINARY_MODE = 493;
141
+ var releaseUrl = (repo, tag, asset) => `https://github.com/${repo}/releases/download/${tag}/${asset}`;
142
+ var releaseBinaryPath = (props) => `${props.directory}/${props.name}`;
143
+ var pinnedDownload = (props) => ({
144
+ member: props.member,
145
+ memberSha256: props.sha256,
146
+ sha256: props.archive.sha256,
147
+ size: props.archive.size,
148
+ url: releaseUrl(props.archive.repo, props.archive.tag, props.archive.asset),
149
+ ...props.archive.root === undefined ? {} : { root: props.archive.root }
150
+ });
151
+ var modeProblems = (mode) => {
152
+ if (!Number.isSafeInteger(mode) || mode < 0 || mode > 4095)
153
+ return ["mode must be 0–0o7777"];
154
+ const found = [];
155
+ if ((mode & 3584) !== 0)
156
+ found.push("mode must not set setuid, setgid or sticky");
157
+ if ((mode & 18) !== 0)
158
+ found.push("mode must not be group- or world-writable");
159
+ if ((mode & 64) === 0)
160
+ found.push("mode must let the owner execute it");
161
+ if ((mode & 256) === 0)
162
+ found.push("mode must let the owner read it (it is re-hashed)");
163
+ return found;
164
+ };
165
+ var ARCHIVE_KEYS = ["repo", "tag", "asset", "size", "sha256", "root"];
154
166
  var pinsMoved = (olds, news) => olds.member !== news.member || olds.sha256 !== news.sha256 || ARCHIVE_KEYS.some((key) => olds.archive[key] !== news.archive[key]);
155
167
  var inPlaceRefusal = (olds, news) => `a new pin (${news.archive.tag} ${news.member} ${news.sha256}) at the path of the installed ` + `one (${olds.archive.tag} ${olds.member} ${olds.sha256}) would overwrite it in place; give each ` + "version its own directory (catalogDirectory), so an upgrade is a new path";
156
168
  var binaryProblems = (props) => [
@@ -778,7 +790,7 @@ var concatBytes = (parts) => {
778
790
  }
779
791
  return out;
780
792
  };
781
- var tarReader = (wanted) => {
793
+ var tarReader = (wanted, root) => {
782
794
  const header = new Uint8Array(BLOCK);
783
795
  const members = new Map;
784
796
  const names = [];
@@ -790,6 +802,8 @@ var tarReader = (wanted) => {
790
802
  let zeros = 0;
791
803
  let name = "";
792
804
  let parts;
805
+ let rootSeen = false;
806
+ const rootPrefix = root === undefined ? undefined : `${root}/`;
793
807
  const endEntry = () => {
794
808
  if (parts !== undefined)
795
809
  members.set(name, concatBytes(parts));
@@ -812,20 +826,45 @@ var tarReader = (wanted) => {
812
826
  if (!posix && magic !== "ustar \x00")
813
827
  throw refuse("an entry header is neither ustar nor GNU");
814
828
  const prefix = posix ? text(header, 345, 155) : "";
815
- name = prefix === "" ? text(header, 0, 100) : `${prefix}/${text(header, 0, 100)}`;
816
- const problem = nameProblem(name);
829
+ const rawName = prefix === "" ? text(header, 0, 100) : `${prefix}/${text(header, 0, 100)}`;
830
+ const problem = nameProblem(rawName);
817
831
  if (problem !== undefined)
818
- throw refuse(`entry ${JSON.stringify(name)} ${problem}`);
832
+ throw refuse(`entry ${JSON.stringify(rawName)} ${problem}`);
833
+ if (rootPrefix !== undefined && rawName === rootPrefix) {
834
+ if (rootSeen) {
835
+ throw refuse(`entry "${rawName}" reuses the declared root's own name, appearing twice`);
836
+ }
837
+ const type2 = String.fromCharCode(header[156] ?? 0);
838
+ const size = octal(header, 124, 12, `entry "${rawName}"'s size`);
839
+ if (type2 !== "5" || size !== 0) {
840
+ throw refuse(`entry "${rawName}" is the declared root but is not an empty directory`);
841
+ }
842
+ rootSeen = true;
843
+ phase = "header";
844
+ return;
845
+ }
846
+ let stripped = rawName;
847
+ if (rootPrefix !== undefined) {
848
+ if (!rawName.startsWith(rootPrefix)) {
849
+ throw refuse(`entry "${rawName}" is outside the declared root "${rootPrefix}"`);
850
+ }
851
+ stripped = rawName.slice(rootPrefix.length);
852
+ const strippedProblem = nameProblem(stripped);
853
+ if (strippedProblem !== undefined) {
854
+ throw refuse(`entry "${rawName}" strips to ${JSON.stringify(stripped)}, which ${strippedProblem}`);
855
+ }
856
+ }
857
+ name = stripped;
819
858
  const type = String.fromCharCode(header[156] ?? 0);
820
859
  if (type !== "0" && type !== "\x00") {
821
860
  const kind = KINDS[type] ?? `of unknown type ${JSON.stringify(type)}`;
822
- throw refuse(`entry "${name}" is ${kind}; only regular files are accepted`);
861
+ throw refuse(`entry "${rawName}" is ${kind}; only regular files are accepted`);
823
862
  }
824
863
  if (seen.has(name))
825
- throw refuse(`entry "${name}" appears twice`);
864
+ throw refuse(`entry "${rawName}" appears twice`);
826
865
  seen.add(name);
827
866
  names.push(name);
828
- remaining = octal(header, 124, 12, `entry "${name}"'s size`);
867
+ remaining = octal(header, 124, 12, `entry "${rawName}"'s size`);
829
868
  padding = (BLOCK - remaining % BLOCK) % BLOCK;
830
869
  parts = wanted.has(name) ? [] : undefined;
831
870
  phase = "data";
@@ -869,6 +908,9 @@ var tarReader = (wanted) => {
869
908
  const finish = () => {
870
909
  if (phase !== "end")
871
910
  throw refuse("the archive stops before its end-of-archive marker");
911
+ if (rootPrefix !== undefined && !rootSeen) {
912
+ throw refuse(`the declared root "${rootPrefix}" never appears in the archive`);
913
+ }
872
914
  return { members, names };
873
915
  };
874
916
  return { finish, push };
@@ -876,8 +918,8 @@ var tarReader = (wanted) => {
876
918
 
877
919
  // src/release/archive.ts
878
920
  var SLICE = 1 << 20;
879
- var extractMembers = async (gzipped, wanted) => {
880
- const tar = tarReader(wanted);
921
+ var extractMembers = async (gzipped, wanted, root) => {
922
+ const tar = tarReader(wanted, root);
881
923
  let offset = 0;
882
924
  const source = new ReadableStream({
883
925
  pull(controller) {
@@ -917,11 +959,12 @@ var verifiedMember = async (archive, release) => {
917
959
  const archiveSha = sha256Hex(archive);
918
960
  if (archiveSha !== release.sha256)
919
961
  throw mismatch(release.url, release.sha256, archiveSha);
920
- const { members, names } = await extractMembers(archive, new Set([release.member]));
962
+ const { members, names } = await extractMembers(archive, new Set([release.member]), release.root);
921
963
  const bytes = members.get(release.member);
922
964
  if (bytes === undefined) {
965
+ const under = release.root === undefined ? "" : ` under root "${release.root}/"`;
923
966
  throw new ArchiveRefused({
924
- message: `${release.url} has no member named exactly "${release.member}" (it has ${names.map((n) => `"${n}"`).join(", ") || "none"})`
967
+ message: `${release.url} has no member named exactly "${release.member}"${under} (it has ${names.map((n) => `"${n}"`).join(", ") || "none"})`
925
968
  });
926
969
  }
927
970
  const memberSha = sha256Hex(bytes);
@@ -1214,9 +1257,16 @@ var catalogBinary = (catalog, request) => {
1214
1257
  message: `Release.Binary ${request.binary}: ${problems.join("; ")}. Nothing was fetched.`
1215
1258
  });
1216
1259
  }
1217
- const { asset, repo, sha256: archiveSha256, size, tag } = archive;
1260
+ const { asset, repo, root, sha256: archiveSha256, size, tag } = archive;
1218
1261
  return {
1219
- archive: { asset, repo, sha256: archiveSha256, size, tag },
1262
+ archive: {
1263
+ asset,
1264
+ repo,
1265
+ sha256: archiveSha256,
1266
+ size,
1267
+ tag,
1268
+ ...root === undefined ? {} : { root }
1269
+ },
1220
1270
  member,
1221
1271
  name: request.binary,
1222
1272
  sha256
@@ -1421,5 +1471,5 @@ export {
1421
1471
  releaseUrl
1422
1472
  };
1423
1473
 
1424
- //# debugId=95AC8419C10B267864756E2164756E21
1474
+ //# debugId=684C5D2BD8F11B9A64756E2164756E21
1425
1475
  //# sourceMappingURL=index.js.map