@forwardimpact/libcli 0.1.15 → 0.1.16

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@forwardimpact/libcli",
3
- "version": "0.1.15",
3
+ "version": "0.1.16",
4
4
  "description": "Agent-friendly CLIs — self-documenting entry points that humans and agents reach through the same interface.",
5
5
  "keywords": [
6
6
  "cli",
package/src/embed.js CHANGED
@@ -47,6 +47,20 @@ export function embeddedAssetsActive() {
47
47
  return registry.size > 0;
48
48
  }
49
49
 
50
+ /**
51
+ * Clear every registered mount, restoring the unregistered state in which
52
+ * {@link embeddedAssetsActive} is false and {@link withEmbeddedAssets} is a
53
+ * no-op. Production never calls this: a compiled binary registers once at
54
+ * startup via the generated barrel and never resets. It exists so a test
55
+ * exercising the on-disk (unregistered) branch is hermetic regardless of the
56
+ * order tests run in a shared `bun test` process — `registerAssets` writes a
57
+ * module-global registry, so a test that registers a mount would otherwise leak
58
+ * the active flag into every later test file.
59
+ */
60
+ export function resetEmbeddedAssets() {
61
+ registry.clear();
62
+ }
63
+
50
64
  /**
51
65
  * True when this process is a `bun build --compile` standalone binary.
52
66
  *
package/src/index.js CHANGED
@@ -2,6 +2,7 @@ export { Cli, createCli } from "./cli.js";
2
2
  export { resolveVersion } from "./version.js";
3
3
  export {
4
4
  registerAssets,
5
+ resetEmbeddedAssets,
5
6
  embeddedAssetsActive,
6
7
  LIBCLI_IS_COMPILED,
7
8
  embeddedDir,