@meru454545/nexus-modscript-composer 2.0.12 → 2.0.13

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 (2) hide show
  1. package/README.md +19 -3
  2. package/package.json +1 -1
package/README.md CHANGED
@@ -152,9 +152,9 @@ const result = await generateFinalScript([nexusDeletionL0], {
152
152
  });
153
153
  ```
154
154
 
155
- This produces the isolated task `\NexusDeletionVerifier\NexusDeletionVerifier-<jobId>` and only uses `C:\ProgramData\NexusDeletionVerifier\<jobId>`. It does not share the normal `NexusModScripts` root. L1 writes `completion.ack` only when all three conditions hold: the L0 result has `data.complete: true`, its `data.job_id` matches the configured job, and Iceberg returned a 2xx response for that exact envelope. L2 then unregisters the verifier task and deletes only its isolated root.
155
+ This produces the isolated task `\NexusDeletionVerifier\NexusDeletionVerifier-<jobId>` and only uses `C:\ProgramData\NexusDeletionVerifier\<jobId>`. It does not share the normal `NexusModScripts` root. The post-RMM finisher is embedded in this verifier; no second finisher script or scheduled task is created. It remains dormant until Iceberg creates `delete.intent` in the job root. L1 writes `completion.ack` only when all three conditions hold: the L0 result has `data.complete: true`, its `data.job_id` matches the configured job, and Iceberg returned a 2xx response for that exact envelope. L2 then unregisters the verifier task and deletes only its isolated root.
156
156
 
157
- The normal bulk cleanup helper is [`scripts/purge-nexus-modscripts.ps1`](scripts/purge-nexus-modscripts.ps1). It removes regular `\NexusModScripts\` deployments and deliberately never removes a deletion verifier.
157
+ For a deletion job, run [`scripts/prepare-nexus-rmm-deletion.ps1`](scripts/prepare-nexus-rmm-deletion.ps1). It combines ordinary ModScript purging with the silent Nexus Endpoint desktop-app uninstall while deliberately preserving `nexusrmm`, Nexus Mesh, and the isolated verifier. [`scripts/purge-nexus-modscripts.ps1`](scripts/purge-nexus-modscripts.ps1) remains available as the backwards-compatible purge-only helper.
158
158
 
159
159
  ### Iceberg controller contract
160
160
 
@@ -176,4 +176,20 @@ The controller must create a unique job ID and callback token, deploy the verifi
176
176
  }
177
177
  ```
178
178
 
179
- Require the scoped token plus `X-Nexus-Deletion-Job` to match the job. Deduplicate `X-Nexus-Event-Id`; persist every non-complete scan as progress; and mark the job complete only after receiving this complete event. Record `AUOptions` before installation and pass that original value (or `null` when absent) as `expectedWindowsUpdateAuOptions`; restore it before accepting completion. For existing machines that lack this installation-time journal, require an explicit administrator-selected baseline and keep the job pending until one is supplied. Do not rely on the TacticalRMM DELETE HTTP response as proof of endpoint cleanup: it removes the management record before the agent-side uninstall has necessarily finished. Start the verifier after all ordinary modular scripts have been purged and before the first endpoint/RMM removal action, so it remains available to observe the final state.
179
+ Require the scoped token plus `X-Nexus-Deletion-Job` to match the job. Deduplicate `X-Nexus-Event-Id`; persist every non-complete scan as progress; and mark the job complete only after receiving this complete event. Record `AUOptions` before installation and pass that original value (or `null` when absent) as `expectedWindowsUpdateAuOptions`; restore it before accepting completion. For existing machines that lack this installation-time journal, require an explicit administrator-selected baseline and keep the job pending until one is supplied. Do not rely on the TacticalRMM DELETE HTTP response as proof of endpoint cleanup: it removes the management record before the agent-side uninstall has necessarily finished.
180
+
181
+ Use this controller order:
182
+
183
+ 1. Create and durably persist the deletion job, scoped callback token, RMM agent ID, and recorded `AUOptions` baseline.
184
+ 2. Generate and run the deletion-verifier L2. L2 registers and immediately starts `\NexusDeletionVerifier\NexusDeletionVerifier-<jobId>`. Wait for at least one authenticated progress callback so the verifier is known to be alive.
185
+ 3. While `nexusrmm` is still connected, run `prepare-nexus-rmm-deletion.ps1` as Administrator. Require its JSON result to be `prepared` or explicitly accept `prepared_with_warnings` after recording the warnings. Do not advance on `preparation_incomplete`; record its `remaining` list and retry or investigate.
186
+ 4. Commit the irreversible deletion intent/outbox entry in Iceberg, then create the verifier gate on the machine:
187
+
188
+ ```powershell
189
+ New-Item -ItemType File -Path "C:\ProgramData\NexusDeletionVerifier\<jobId>\delete.intent" -Force | Out-Null
190
+ ```
191
+
192
+ 5. Immediately call TacticalRMM `DELETE /agents/<rmm-agent-id>/`. The next verifier run sees the intent, waits up to five minutes for the normal agent uninstall, invokes the local RMM uninstaller only as a fallback, performs allowlisted residual cleanup, restores `AUOptions`, and then runs the read-only L0 scan.
193
+ 6. Keep the job pending until the authenticated `complete: true` event is accepted. That 2xx acknowledgement creates `completion.ack`; the existing verifier wrapper then deletes its own scheduled task and isolated job directory.
194
+
195
+ Steps 4 and 5 must be retryable from the durable outbox state. Creating `delete.intent`, calling TacticalRMM DELETE, running the embedded finisher, processing callback event IDs, and acknowledging an already-complete job are all designed to be idempotent. Never purge `C:\ProgramData\NexusDeletionVerifier` from the controller; the acknowledged verifier removes itself.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@meru454545/nexus-modscript-composer",
3
- "version": "2.0.12",
3
+ "version": "2.0.13",
4
4
  "description": "Compose multi-layer deployment scripts for NexusEPM agents (L0 → L1 → L2 pipeline)",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",