@wyattjoh/demur 0.4.1 → 0.4.2

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/README.md CHANGED
@@ -92,7 +92,7 @@ Pin a specific release when reproducibility matters:
92
92
 
93
93
  <!-- x-release-please-start-version -->
94
94
  ```sh
95
- pi install npm:@wyattjoh/demur@0.4.1
95
+ pi install npm:@wyattjoh/demur@0.4.2
96
96
  ```
97
97
  <!-- x-release-please-end -->
98
98
 
@@ -325,6 +325,7 @@ export default function demur(pi: ExtensionAPI): void {
325
325
  return;
326
326
  }
327
327
 
328
+ await refreshSettings(ctx);
328
329
  const toggleLabel = settings.enabled ? "Disable demur" : "Enable demur";
329
330
  const policyLabel = `Change failure policy (current: ${settings.failurePolicy})`;
330
331
  const action = await ctx.ui.select("demur", [toggleLabel, policyLabel]);
@@ -351,6 +352,15 @@ export default function demur(pi: ExtensionAPI): void {
351
352
  });
352
353
 
353
354
  pi.on("session_start", async (_event, ctx) => {
355
+ await refreshSettings(ctx);
356
+ });
357
+
358
+ pi.on("tool_call", async (event, ctx) => {
359
+ await refreshSettings(ctx);
360
+ return handleToolCall(event, ctx, settings);
361
+ });
362
+
363
+ async function refreshSettings(ctx: ExtensionContext): Promise<void> {
354
364
  try {
355
365
  settings = await loadDemurSettings();
356
366
  } catch (error: unknown) {
@@ -361,11 +371,7 @@ export default function demur(pi: ExtensionAPI): void {
361
371
  );
362
372
  }
363
373
  updateStatus(ctx, settings);
364
- });
365
-
366
- pi.on("tool_call", (event, ctx) =>
367
- handleToolCall(event, ctx, settings),
368
- );
374
+ }
369
375
 
370
376
  async function persistSettings(
371
377
  nextSettings: DemurSettings,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wyattjoh/demur",
3
- "version": "0.4.1",
3
+ "version": "0.4.2",
4
4
  "type": "module",
5
5
  "description": "A proof-of-concept destructive-command guard for coding agents.",
6
6
  "license": "MIT",