zyrk 0.3.8 → 0.4.8

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 (218) hide show
  1. package/README.md +143 -34
  2. package/SECURITY.md +42 -0
  3. package/VERSION +1 -1
  4. package/bin/zyrk.js +9 -1
  5. package/dist/cli/main.d.ts +40 -0
  6. package/dist/cli/main.d.ts.map +1 -0
  7. package/dist/cli/main.js +605 -0
  8. package/dist/cli/npm-delegate.d.ts +38 -0
  9. package/dist/cli/npm-delegate.d.ts.map +1 -0
  10. package/{src/cli/npm-delegate.ts → dist/cli/npm-delegate.js} +21 -55
  11. package/dist/cli/parse.d.ts +40 -0
  12. package/dist/cli/parse.d.ts.map +1 -0
  13. package/dist/cli/parse.js +78 -0
  14. package/dist/commands/dependencies.d.ts +13 -0
  15. package/dist/commands/dependencies.d.ts.map +1 -0
  16. package/dist/commands/dependencies.js +119 -0
  17. package/dist/commands/deploy.d.ts +15 -0
  18. package/dist/commands/deploy.d.ts.map +1 -0
  19. package/dist/commands/deploy.js +761 -0
  20. package/dist/commands/maintenance.d.ts +28 -0
  21. package/dist/commands/maintenance.d.ts.map +1 -0
  22. package/dist/commands/maintenance.js +225 -0
  23. package/dist/commands/patch.d.ts +39 -0
  24. package/dist/commands/patch.d.ts.map +1 -0
  25. package/dist/commands/patch.js +353 -0
  26. package/dist/commands/project.d.ts +17 -0
  27. package/dist/commands/project.d.ts.map +1 -0
  28. package/dist/commands/project.js +519 -0
  29. package/dist/commands/store.d.ts +10 -0
  30. package/dist/commands/store.d.ts.map +1 -0
  31. package/dist/commands/store.js +610 -0
  32. package/dist/config/paths.d.ts +37 -0
  33. package/dist/config/paths.d.ts.map +1 -0
  34. package/dist/config/paths.js +66 -0
  35. package/dist/dlx/create.d.ts +23 -0
  36. package/dist/dlx/create.d.ts.map +1 -0
  37. package/dist/dlx/create.js +59 -0
  38. package/dist/dlx/run.d.ts +53 -0
  39. package/dist/dlx/run.d.ts.map +1 -0
  40. package/dist/dlx/run.js +395 -0
  41. package/dist/errors.d.ts +68 -0
  42. package/dist/errors.d.ts.map +1 -0
  43. package/dist/errors.js +116 -0
  44. package/dist/extract/tarball.d.ts +86 -0
  45. package/dist/extract/tarball.d.ts.map +1 -0
  46. package/dist/extract/tarball.js +727 -0
  47. package/dist/fetch/all.d.ts +54 -0
  48. package/dist/fetch/all.d.ts.map +1 -0
  49. package/dist/fetch/all.js +168 -0
  50. package/dist/fetch/package.d.ts +65 -0
  51. package/dist/fetch/package.d.ts.map +1 -0
  52. package/dist/fetch/package.js +197 -0
  53. package/dist/fetch/registry.d.ts +125 -0
  54. package/dist/fetch/registry.d.ts.map +1 -0
  55. package/dist/fetch/registry.js +674 -0
  56. package/dist/install/import-npm.d.ts +4 -0
  57. package/dist/install/import-npm.d.ts.map +1 -0
  58. package/dist/install/import-npm.js +156 -0
  59. package/dist/install/lock.d.ts +10 -0
  60. package/dist/install/lock.d.ts.map +1 -0
  61. package/dist/install/lock.js +239 -0
  62. package/dist/install/metadata.d.ts +25 -0
  63. package/dist/install/metadata.d.ts.map +1 -0
  64. package/dist/install/metadata.js +92 -0
  65. package/dist/install/private.d.ts +46 -0
  66. package/dist/install/private.d.ts.map +1 -0
  67. package/dist/install/private.js +304 -0
  68. package/dist/install/registry.d.ts +8 -0
  69. package/dist/install/registry.d.ts.map +1 -0
  70. package/dist/install/registry.js +98 -0
  71. package/dist/install/repair.d.ts +22 -0
  72. package/dist/install/repair.d.ts.map +1 -0
  73. package/dist/install/repair.js +115 -0
  74. package/dist/install/run.d.ts +45 -0
  75. package/dist/install/run.d.ts.map +1 -0
  76. package/dist/install/run.js +716 -0
  77. package/dist/install/source-policy.d.ts +11 -0
  78. package/dist/install/source-policy.d.ts.map +1 -0
  79. package/dist/install/source-policy.js +8 -0
  80. package/dist/install/workspace-graph.d.ts +62 -0
  81. package/dist/install/workspace-graph.d.ts.map +1 -0
  82. package/dist/install/workspace-graph.js +365 -0
  83. package/dist/install/workspace-install.d.ts +3 -0
  84. package/dist/install/workspace-install.d.ts.map +1 -0
  85. package/dist/install/workspace-install.js +527 -0
  86. package/dist/install/workspace-lock.d.ts +16 -0
  87. package/dist/install/workspace-lock.d.ts.map +1 -0
  88. package/dist/install/workspace-lock.js +428 -0
  89. package/dist/install/workspace-mutation.d.ts +10 -0
  90. package/dist/install/workspace-mutation.d.ts.map +1 -0
  91. package/dist/install/workspace-mutation.js +154 -0
  92. package/dist/install/workspace-transaction.d.ts +26 -0
  93. package/dist/install/workspace-transaction.d.ts.map +1 -0
  94. package/dist/install/workspace-transaction.js +191 -0
  95. package/dist/install/workspaces.d.ts +66 -0
  96. package/dist/install/workspaces.d.ts.map +1 -0
  97. package/dist/install/workspaces.js +343 -0
  98. package/dist/lockfile/fingerprints.d.ts +45 -0
  99. package/dist/lockfile/fingerprints.d.ts.map +1 -0
  100. package/dist/lockfile/fingerprints.js +65 -0
  101. package/dist/lockfile/read.d.ts +27 -0
  102. package/dist/lockfile/read.d.ts.map +1 -0
  103. package/dist/lockfile/read.js +136 -0
  104. package/dist/lockfile/types.d.ts +77 -0
  105. package/dist/lockfile/types.d.ts.map +1 -0
  106. package/dist/lockfile/types.js +18 -0
  107. package/dist/lockfile/write.d.ts +36 -0
  108. package/dist/lockfile/write.d.ts.map +1 -0
  109. package/dist/lockfile/write.js +211 -0
  110. package/dist/log.d.ts +24 -0
  111. package/dist/log.d.ts.map +1 -0
  112. package/dist/log.js +126 -0
  113. package/dist/project/projection.d.ts +50 -0
  114. package/dist/project/projection.d.ts.map +1 -0
  115. package/dist/project/projection.js +292 -0
  116. package/dist/resolve/resolver.d.ts +99 -0
  117. package/dist/resolve/resolver.d.ts.map +1 -0
  118. package/dist/resolve/resolver.js +669 -0
  119. package/dist/resolve/spec.d.ts +26 -0
  120. package/dist/resolve/spec.d.ts.map +1 -0
  121. package/dist/resolve/spec.js +87 -0
  122. package/dist/store/db.d.ts +49 -0
  123. package/dist/store/db.d.ts.map +1 -0
  124. package/{src/store/db.ts → dist/store/db.js} +106 -206
  125. package/dist/store/graph.d.ts +60 -0
  126. package/dist/store/graph.d.ts.map +1 -0
  127. package/dist/store/graph.js +115 -0
  128. package/dist/store/layout.d.ts +71 -0
  129. package/dist/store/layout.d.ts.map +1 -0
  130. package/dist/store/layout.js +282 -0
  131. package/dist/store/manifests.d.ts +78 -0
  132. package/dist/store/manifests.d.ts.map +1 -0
  133. package/dist/store/manifests.js +238 -0
  134. package/dist/store/objects.d.ts +59 -0
  135. package/dist/store/objects.d.ts.map +1 -0
  136. package/dist/store/objects.js +194 -0
  137. package/dist/store/realize.d.ts +44 -0
  138. package/dist/store/realize.d.ts.map +1 -0
  139. package/dist/store/realize.js +302 -0
  140. package/dist/store/source.d.ts +42 -0
  141. package/dist/store/source.d.ts.map +1 -0
  142. package/dist/store/source.js +169 -0
  143. package/dist/store/txn.d.ts +37 -0
  144. package/dist/store/txn.d.ts.map +1 -0
  145. package/dist/store/txn.js +97 -0
  146. package/dist/store/verify.d.ts +41 -0
  147. package/dist/store/verify.d.ts.map +1 -0
  148. package/dist/store/verify.js +405 -0
  149. package/dist/util/fsx.d.ts +54 -0
  150. package/dist/util/fsx.d.ts.map +1 -0
  151. package/dist/util/fsx.js +259 -0
  152. package/dist/util/hash.d.ts +48 -0
  153. package/dist/util/hash.d.ts.map +1 -0
  154. package/dist/util/hash.js +80 -0
  155. package/dist/util/ids.d.ts +19 -0
  156. package/dist/util/ids.d.ts.map +1 -0
  157. package/dist/util/ids.js +38 -0
  158. package/dist/util/integrity.d.ts +107 -0
  159. package/dist/util/integrity.d.ts.map +1 -0
  160. package/dist/util/integrity.js +227 -0
  161. package/dist/util/json.d.ts +14 -0
  162. package/dist/util/json.d.ts.map +1 -0
  163. package/dist/util/json.js +78 -0
  164. package/dist/util/locks.d.ts +40 -0
  165. package/dist/util/locks.d.ts.map +1 -0
  166. package/dist/util/locks.js +219 -0
  167. package/dist/util/proc.d.ts +53 -0
  168. package/dist/util/proc.d.ts.map +1 -0
  169. package/dist/util/proc.js +189 -0
  170. package/dist/version.d.ts +27 -0
  171. package/dist/version.d.ts.map +1 -0
  172. package/{src/version.ts → dist/version.js} +0 -8
  173. package/package.json +9 -4
  174. package/src/cli/main.ts +0 -602
  175. package/src/cli/parse.ts +0 -106
  176. package/src/commands/dependencies.ts +0 -154
  177. package/src/commands/deploy.ts +0 -777
  178. package/src/commands/maintenance.ts +0 -260
  179. package/src/commands/patch.ts +0 -408
  180. package/src/commands/project.ts +0 -598
  181. package/src/commands/store.ts +0 -689
  182. package/src/config/paths.ts +0 -119
  183. package/src/dlx/create.ts +0 -69
  184. package/src/dlx/run.ts +0 -389
  185. package/src/errors.ts +0 -142
  186. package/src/extract/tarball.ts +0 -868
  187. package/src/fetch/all.ts +0 -206
  188. package/src/fetch/package.ts +0 -181
  189. package/src/fetch/registry.ts +0 -615
  190. package/src/install/import-npm.ts +0 -177
  191. package/src/install/lock.ts +0 -176
  192. package/src/install/metadata.ts +0 -122
  193. package/src/install/registry.ts +0 -88
  194. package/src/install/run.ts +0 -760
  195. package/src/lockfile/fingerprints.ts +0 -74
  196. package/src/lockfile/read.ts +0 -198
  197. package/src/lockfile/types.ts +0 -75
  198. package/src/lockfile/write.ts +0 -257
  199. package/src/log.ts +0 -100
  200. package/src/project/projection.ts +0 -390
  201. package/src/resolve/resolver.ts +0 -757
  202. package/src/resolve/spec.ts +0 -131
  203. package/src/store/graph.ts +0 -175
  204. package/src/store/layout.ts +0 -431
  205. package/src/store/manifests.ts +0 -347
  206. package/src/store/objects.ts +0 -229
  207. package/src/store/realize.ts +0 -322
  208. package/src/store/source.ts +0 -249
  209. package/src/store/txn.ts +0 -118
  210. package/src/store/verify.ts +0 -433
  211. package/src/types/vendor.d.ts +0 -120
  212. package/src/util/fsx.ts +0 -289
  213. package/src/util/hash.ts +0 -117
  214. package/src/util/ids.ts +0 -42
  215. package/src/util/integrity.ts +0 -269
  216. package/src/util/json.ts +0 -89
  217. package/src/util/locks.ts +0 -266
  218. package/src/util/proc.ts +0 -108
package/README.md CHANGED
@@ -37,9 +37,9 @@ zyrk --help
37
37
  zyrk --version
38
38
  ```
39
39
 
40
- Requires **Node.js 24 or newer**. The source runs directly with Node's native
41
- TypeScript support; no compilation step or native toolchain is required to
42
- install zyrk itself.
40
+ Requires **Node.js 24 or newer**. Published packages contain compiled JavaScript. A checkout runs TypeScript
41
+ through Node's native type stripping; the check gate also builds and tests the
42
+ source-free package layout. Installing zyrk requires no native toolchain.
43
43
 
44
44
  From a checkout:
45
45
 
@@ -90,19 +90,60 @@ Offline installs use locked verified sources and fail if an input is missing.
90
90
  Manifest, lock, and projection changes are journaled for process-crash recovery;
91
91
  a failed resolution, verification, or build-policy check keeps the prior graph.
92
92
 
93
- Dependency install scripts and implicit native builds are blocked by default.
94
- `--ignore-scripts` explicitly produces an **intentionally unbuilt** installation.
95
- Root install hooks are reported and never run automatically. Script approval,
96
- private native builds, runtime-mutable packages, workspaces, overrides, Git/local
97
- sources, and authenticated or mixed scoped registries are not supported by this
98
- install path yet. Unsupported platform constraints and failed optional packages
99
- currently fail installation instead of being silently omitted. macOS/Windows
100
- compatibility and framework support remain unverified.
93
+ Dependency install scripts and implicit `binding.gyp` builds require explicit
94
+ approval. Review first, trust the selected sources, then install:
101
95
 
102
- Use `--registry=https://your-registry.example/` for a compatible unauthenticated
103
- registry. The adapter reads the default registry from user/project `.npmrc`, and
104
- fails closed on scoped registry routing or disabled TLS verification. Tool
105
- commands (`dlx`/`create`) still use their existing public-registry configuration.
96
+ ```bash
97
+ zyrk approve-builds # inspect exact sources and commands; executes no package code
98
+ zyrk approve-builds esbuild # approve reviewed candidates by package name
99
+ zyrk install
100
+ zyrk rebuild --offline # rebuild the complete approved locked graph
101
+ ```
102
+
103
+ Approvals are local to the exact graph, sources, patch contents, and script
104
+ policy. Mandatory user denies override project approvals. Approved scripts run
105
+ with your account's permissions; permission is not a sandbox. Packages that need
106
+ writes use a complete private dependency generation under `.zyrk-local/`, with
107
+ independent writable files and dependency links confined to that generation.
108
+ Build failure keeps the previous project graph active. `--ignore-scripts`
109
+ explicitly publishes an **intentionally unbuilt** installation. Root install
110
+ hooks never run automatically. A project can request runtime writable packages
111
+ with `"zyrk": { "mutablePackages": ["package-name"] }`; this also uses a complete
112
+ private graph.
113
+
114
+ Default registry and authentication settings are loaded from user/project
115
+ `.npmrc` for installation, dependency edits, `dlx`, and `create`. Environment
116
+ token placeholders are supported. Credentials are restricted to their configured
117
+ scheme, host, port, and path; redirects cannot expand that scope. Use
118
+ `--registry=https://your-registry.example/` on install for an explicit registry.
119
+ Mixed scoped routing and disabled TLS verification are rejected before public
120
+ lookup. Git sources, non-workspace local sources, and overrides remain unsupported;
121
+ they fail explicitly. Optional dependencies incompatible with the selected platform
122
+ are omitted; missing packages, integrity failures, and other optional failures
123
+ remain errors. Platform selection is recorded in the lock. macOS, Windows, and
124
+ broad framework compatibility have not passed their release gates.
125
+
126
+ ### Workspaces
127
+
128
+ Standard `package.json` workspaces use one root lock and a recoverable transaction
129
+ for all importer projections. Workspace packages remain editable live directories;
130
+ registry closures independent of live sources can still use shared realizations.
131
+ Run install or dependency edits from the root or a member directory. Root settings
132
+ and registry policy apply to every member.
133
+
134
+ ```bash
135
+ zyrk install
136
+ zyrk run --workspace app start # exact workspace name or relative path
137
+ zyrk run --recursive build # dependency-first member scripts
138
+ cd packages/app
139
+ zyrk add package-name # edit this importer, preserve other selections
140
+ ```
141
+
142
+ Frozen/offline installs, live peers, patches, mutable registry packages, inspection,
143
+ and repair have workspace fixtures. Builds that reach live workspace sources are
144
+ blocked before execution. Workspace npm-lock adoption and portable workspace
145
+ export still need adapters and fail explicitly. Recursive execution supports
146
+ member scripts; filters are exact names or paths, not arbitrary glob expressions.
106
147
 
107
148
  ### Run a one-off tool
108
149
 
@@ -115,15 +156,17 @@ When running from source, replace `zyrk` with `node bin/zyrk.js`.
115
156
 
116
157
  `dlx` resolves the requested package and its dependencies, verifies downloaded
117
158
  archives, creates a dependency-aware tool graph, and launches the selected
118
- JavaScript bin entry with the supplied arguments. Its temporary projection is
159
+ JavaScript, shell, or native executable bin entry with the supplied arguments. Its temporary projection is
119
160
  removed afterward; verified sources and shared realizations remain in the
120
161
  store.
121
162
 
122
163
  `create` uses the same execution path and maps initializer names to their
123
164
  `create-*` packages. For example, `vite` maps to `create-vite`, while a scoped
124
165
  initializer stays in its scope. Compatibility depends on the selected tool:
125
- closures declaring install lifecycle scripts are currently blocked, and native
126
- or shell executable bins are not supported by the JavaScript-only launcher.
166
+ closures declaring install lifecycle scripts, implicit native builds, or bundled
167
+ install hooks are blocked. Dependency executables are available on the tool
168
+ PATH. Parent cancellation terminates the supervised process group with bounded
169
+ escalation on POSIX systems.
127
170
 
128
171
  These commands run the tool's code with your account's permissions. The tool
129
172
  working directory is your current directory. A temporary tool projection is
@@ -131,16 +174,77 @@ not a sandbox.
131
174
 
132
175
  ### Current command coverage
133
176
 
134
- | Surface | Current behavior |
135
- | -------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------- |
136
- | `install`, `i` | Resolve or reuse the lock, verify sources, and publish shared project dependencies. |
137
- | `--help`, `--version` | Show the CLI surface and package version. |
138
- | `dlx`, `create` | Resolve, fetch, verify archives, and run temporary tool environments. |
139
- | `publish`, `unpublish`, `access`, `deprecate`, `dist-tag`, `owner` | Explicitly delegate to your npm CLI. |
140
- | `token`, `adduser`, `login`, `logout`, `whoami`, `ping`, `pack` | Explicitly delegate to your npm CLI. |
141
- | `add`, `remove`, `update`, `run`, `exec` | Report `ZYRK_NOT_IMPLEMENTED`. |
142
- | `store`, `projects`, `repair`, `import`, `deploy`, `docker` | Report `ZYRK_NOT_IMPLEMENTED`. |
143
- | `list`, `why`, `doctor`, `approve-builds`, `rebuild`, `audit`, `patch`, `patch-commit` | Report `ZYRK_NOT_IMPLEMENTED`. |
177
+ | Commands | Behavior |
178
+ | ----------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------- |
179
+ | `install`, `i`, `add`, `remove`, `update` | Resolve or reuse exact selections; publish verified dependencies transactionally. |
180
+ | `import --from npm` | Adopt supported npm v2/v3 lock selections without changing versions. |
181
+ | `fetch --frozen-lockfile` | Prefetch verified locked sources without running scripts or publishing a projection. |
182
+ | `run`, `exec` | Execute project scripts or installed binaries; `exec` never fetches. |
183
+ | `dlx`, `create` | Verify and run temporary tool closures. |
184
+ | `list`, `why`, `doctor` | Inspect selected dependencies, dependency paths, and project health. |
185
+ | `approve-builds`, `rebuild` | Review and approve exact build candidates; build a new private generation. |
186
+ | `audit` | Query exact selected versions under the project privacy policy; distinguish unavailable service from no known advisories. |
187
+ | `patch`, `patch-commit` | Create a private editing area and portable source-bound patch; apply on reinstall. |
188
+ | `repair` | Re-fetch corrupt locked sources and publish a new realization closure without editing existing shared inodes. |
189
+ | `store path/status/verify/gc/pin/unpin`, `projects list/forget` | Inspect storage, verify content, and manage explicit retention roots. |
190
+ | `deploy`, `docker init/build/run` | Export supported production closures or generate and invoke a pinned Docker setup. |
191
+ | `publish`, `unpublish`, `access`, `deprecate`, `dist-tag`, `owner`, `token`, `adduser`, `login`, `logout`, `whoami`, `ping`, `pack` | Explicitly delegate to your npm CLI. |
192
+
193
+ ### Patches, recovery, and cleanup
194
+
195
+ ```bash
196
+ zyrk patch package-name # prints a private editing directory
197
+ # Edit files in that directory, then:
198
+ zyrk patch-commit <editing-directory>
199
+ zyrk install # refresh the lock and apply the patch privately
200
+ zyrk install --offline --frozen-lockfile
201
+
202
+ zyrk doctor
203
+ zyrk store verify --full
204
+ zyrk repair # preserve locked versions, publish replacement instances
205
+ zyrk store gc --dry-run
206
+ zyrk store gc
207
+ ```
208
+
209
+ Commit `package.json`, `package-lock.json`, and `.zyrk/patches/` artifacts.
210
+ Keep `.zyrk-local/` out of version control: it contains approvals, private builds,
211
+ logs, and local install state. Patches bind to verified source manifests; changed
212
+ patches invalidate frozen selections. Other projects retain their selected
213
+ package instances. Repair retains incident evidence and replaces corrupted
214
+ object pathnames, so existing hard links are never rewritten in place.
215
+
216
+ GC uses recorded project roots, pins, leases, a store coordination lock, and a
217
+ 30-day grace period. Preview collection before removing retention roots. Live
218
+ or uncertain owners are retained. A process killed inside the short lock-publication
219
+ guard can leave a guard requiring manual recovery after all zyrk processes stop;
220
+ zyrk fails closed instead of guessing which process owns it.
221
+
222
+ ### Export an application
223
+
224
+ Declare runtime files explicitly and select a direct Node entry:
225
+
226
+ ```bash
227
+ zyrk deploy --out ./dist-runtime --omit=dev --files dist --entry dist/server.js
228
+ node ./dist-runtime/dist/server.js
229
+ ```
230
+
231
+ The exporter validates that links stay inside the output and excludes the host
232
+ store. Generic export supports shared production graphs and relocatable private
233
+ JavaScript outputs, including selected patches and generated files. Native binaries,
234
+ host-path-dependent outputs, workspace export, and arbitrary shell startup adapters
235
+ remain unsupported. Exports validate active generation/profile metadata and reject
236
+ credentials or escaping links. Structural validation does not prove application health. Run an
237
+ application smoke test from the exported directory with host-store access removed.
238
+
239
+ `zyrk docker init` requires a supported Node image pinned by SHA-256, a local CLI
240
+ tarball pinned by SHA-512, runtime files, and an entry. It generates reviewable
241
+ `Dockerfile`, `.dockerignore`, `zyrk-docker.json`, and `ZYRK_DOCKER.md`. Builds fetch
242
+ with an optional BuildKit npmrc secret, then install and export without networking.
243
+ `zyrk docker build --tag app:local` and `zyrk docker run --tag app:local` require a
244
+ reachable Docker daemon. Generated configuration has fixture coverage. The opt-in
245
+ `node scripts/docker-smoke.mjs` gate exercises a pinned image and a network-free
246
+ runtime. A Linux daemon run passed cold/warm builds, imports and asset access
247
+ without host mounts. Broad framework compatibility still requires application-specific checks.
144
248
 
145
249
  Native commands that support `--json` return a versioned result envelope.
146
250
  `dlx` and `create` reject that option because the tool owns stdout. Delegated
@@ -164,16 +268,18 @@ The design separates three things:
164
268
  publication. Extraction rejects unsafe paths and links and normalizes modes.
165
269
  - **Dependency context:** a package instance records its selected dependency
166
270
  wiring, so incompatible versions and peer contexts are not merged.
167
- - **Mutable work:** the planned build/runtime mutation model uses private
168
- project generations. Writable build outputs must not change shared source.
271
+ - **Mutable work:** approved builds, patches, and runtime-writable packages use
272
+ independent private project generations. Writable outputs do not alter shared source.
169
273
 
170
274
  Read-only modes help prevent accidental writes; they are not a security boundary
171
275
  against code running as the same OS user. Shared stores should be used only by
172
276
  mutually trusted processes. Do not share them across unrelated CI trust domains.
173
277
 
174
- Native tool commands currently use the public npm registry. Private registry
175
- configuration and credential support are not implemented; do not use these
176
- commands for internal tools that depend on private registry routing.
278
+ Archive expansion, metadata sizes, resolution growth, fetch totals, and operation
279
+ deadlines are bounded. These limits defend against accidental and hostile
280
+ resource exhaustion; they do not make executed dependencies trustworthy.
281
+ Security reports belong in the private reporting channel described in
282
+ [SECURITY.md](SECURITY.md).
177
283
 
178
284
  ## Global installs and npm delegation
179
285
 
@@ -222,7 +328,10 @@ tag after the commit. Keep changes focused and never bypass the hooks.
222
328
 
223
329
  CI checks pushed commits and pull requests. The separate
224
330
  [npm publishing action](.github/workflows/npm-publish.yml) is triggered when a
225
- GitHub release is created; ordinary commits do not trigger that action.
331
+ GitHub release is published. It verifies the release tag, formatting, typecheck,
332
+ build, and tests, then publishes that exact commit. Ordinary commits do not
333
+ publish packages. Dependabot and a scheduled advisory check supplement CI; an
334
+ unavailable advisory service fails separately from a clean result.
226
335
 
227
336
  The contributor guide is [AGENTS.md](AGENTS.md). Bug reports and reproducible
228
337
  compatibility cases belong in
package/SECURITY.md ADDED
@@ -0,0 +1,42 @@
1
+ # Security policy
2
+
3
+ zyrk is pre-release software under active construction. There is no stable or
4
+ long-term-support release line. Security fixes target current development and
5
+ the latest published pre-release; older versions do not receive promised
6
+ backports. No response or remediation deadline is guaranteed.
7
+
8
+ ## Report a vulnerability privately
9
+
10
+ Use [GitHub private vulnerability reporting](https://github.com/kingjethro999/zyrk/security/advisories/new).
11
+ Private reporting is enabled for this repository. Please keep exploit details,
12
+ credentials, and affected users' data out of public issues and discussions.
13
+
14
+ If the form is unavailable, use the contact links on
15
+ [the maintainer's profile](https://github.com/kingjethro999) to request a private
16
+ reporting channel. A public request should contain no vulnerability details.
17
+
18
+ Include the affected version or commit, Node.js version, OS and filesystem,
19
+ a minimal reproduction using disposable fixtures, expected and observed
20
+ behavior, and the likely impact. Describe relevant registry, script-policy,
21
+ store, and command options. Redact tokens, credentials, private package names,
22
+ and personal filesystem paths. A report should not require access to a real
23
+ account or production data to reproduce.
24
+
25
+ The maintainer will assess the report and coordinate fixes and disclosure when
26
+ possible. Please allow coordination before publishing a working exploit. This
27
+ project offers no bug bounty or guaranteed response time.
28
+
29
+ ## Scope and operational limits
30
+
31
+ Reports involving integrity verification, archive extraction, credentials,
32
+ shared-store mutation, project isolation, subprocess cleanup, and portable
33
+ exports are useful. The shared store is scoped to one OS account. Package code
34
+ runs with that account's permissions when explicitly invoked or approved;
35
+ read-only modes and subprocess supervision are not a sandbox. Compatibility
36
+ and platform support are limited to the cases documented and tested in the
37
+ repository.
38
+
39
+ Scheduled dependency audits and Dependabot updates supplement review. An audit
40
+ service failure is reported as unavailable and fails the scheduled check;
41
+ only a valid successful zero-finding report counts as clean. A clean dependency
42
+ audit does not establish that zyrk or its dependencies are free of vulnerabilities.
package/VERSION CHANGED
@@ -1 +1 @@
1
- v0.3.8
1
+ v0.4.8
package/bin/zyrk.js CHANGED
@@ -1,5 +1,13 @@
1
1
  #!/usr/bin/env node
2
- import { runCli } from "../src/cli/main.ts";
2
+ import { existsSync } from "node:fs";
3
+
4
+ // Checkouts run the current source. Published packages contain emitted JS only.
5
+ const source = new URL("../src/cli/main.ts", import.meta.url);
6
+ const { runCli } = await import(
7
+ existsSync(source)
8
+ ? source.href
9
+ : new URL("../dist/cli/main.js", import.meta.url).href
10
+ );
3
11
 
4
12
  process.exitCode = await runCli({
5
13
  argv: process.argv.slice(2),
@@ -0,0 +1,40 @@
1
+ import { ZyrkError } from "../errors.ts";
2
+ export { ZyrkError };
3
+ import { RegistryClient } from "../fetch/registry.ts";
4
+ import { Store } from "../store/layout.ts";
5
+ import { type ParsedArgs } from "./parse.ts";
6
+ export declare const CLI_JSON_SCHEMA_VERSION = 1;
7
+ export declare function helpText(version: string): string;
8
+ export type CliOutput = {
9
+ exitCode: number;
10
+ stdout: string;
11
+ stderr: string;
12
+ };
13
+ /**
14
+ * Pure dispatch: no filesystem, network, or subprocess effects. Returns the
15
+ * exact bytes for stdout/stderr and the process exit code.
16
+ */
17
+ export declare function dispatch(parsed: ParsedArgs, context: {
18
+ version: string;
19
+ env: NodeJS.ProcessEnv;
20
+ }): CliOutput;
21
+ export type ToolEnvironment = {
22
+ store: Store;
23
+ registry: RegistryClient;
24
+ };
25
+ export type RunCliOptions = {
26
+ argv: readonly string[];
27
+ env: NodeJS.ProcessEnv;
28
+ stdout: {
29
+ write(chunk: string): unknown;
30
+ };
31
+ stderr: {
32
+ write(chunk: string): unknown;
33
+ };
34
+ readVersion?: () => string;
35
+ cwd?: string;
36
+ tools?: () => Promise<ToolEnvironment>;
37
+ };
38
+ /** Parse, dispatch, delegate, or run a tool, and emit. The only impure seam. */
39
+ export declare function runCli(options: RunCliOptions): Promise<number>;
40
+ //# sourceMappingURL=main.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"main.d.ts","sourceRoot":"","sources":["../../src/cli/main.ts"],"names":[],"mappings":"AA0BA,OAAO,EAAe,SAAS,EAAe,MAAM,cAAc,CAAC;AACnE,OAAO,EAAE,SAAS,EAAE,CAAC;AACrB,OAAO,EAAoB,cAAc,EAAE,MAAM,sBAAsB,CAAC;AAExE,OAAO,EAAE,KAAK,EAAE,MAAM,oBAAoB,CAAC;AAM3C,OAAO,EAAqC,KAAK,UAAU,EAAE,MAAM,YAAY,CAAC;AAEhF,eAAO,MAAM,uBAAuB,IAAI,CAAC;AA2DzC,wBAAgB,QAAQ,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,CAwBhD;AAED,MAAM,MAAM,SAAS,GAAG;IACtB,QAAQ,EAAE,MAAM,CAAC;IACjB,MAAM,EAAE,MAAM,CAAC;IACf,MAAM,EAAE,MAAM,CAAC;CAChB,CAAC;AA6EF;;;GAGG;AACH,wBAAgB,QAAQ,CACtB,MAAM,EAAE,UAAU,EAClB,OAAO,EAAE;IAAE,OAAO,EAAE,MAAM,CAAC;IAAC,GAAG,EAAE,MAAM,CAAC,UAAU,CAAA;CAAE,GACnD,SAAS,CAgDX;AAmBD,MAAM,MAAM,eAAe,GAAG;IAC5B,KAAK,EAAE,KAAK,CAAC;IACb,QAAQ,EAAE,cAAc,CAAC;CAC1B,CAAC;AAEF,MAAM,MAAM,aAAa,GAAG;IAC1B,IAAI,EAAE,SAAS,MAAM,EAAE,CAAC;IACxB,GAAG,EAAE,MAAM,CAAC,UAAU,CAAC;IACvB,MAAM,EAAE;QAAE,KAAK,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO,CAAA;KAAE,CAAC;IAC1C,MAAM,EAAE;QAAE,KAAK,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO,CAAA;KAAE,CAAC;IAC1C,WAAW,CAAC,EAAE,MAAM,MAAM,CAAC;IAC3B,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,KAAK,CAAC,EAAE,MAAM,OAAO,CAAC,eAAe,CAAC,CAAC;CACxC,CAAC;AAEF,gFAAgF;AAChF,wBAAsB,MAAM,CAAC,OAAO,EAAE,aAAa,GAAG,OAAO,CAAC,MAAM,CAAC,CAqZpE"}