@blogic-cz/agent-tools 0.14.53 → 0.14.54

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": "@blogic-cz/agent-tools",
3
- "version": "0.14.53",
3
+ "version": "0.14.54",
4
4
  "description": "CLI tools for AI coding agent workflows — GitHub, database, Kubernetes, Azure DevOps, logs, sessions, and audit",
5
5
  "keywords": [
6
6
  "agent",
@@ -53,6 +53,16 @@ export function resolveDbAccessMode(
53
53
  };
54
54
  }
55
55
 
56
+ export function isFullyReadOnly(
57
+ config: Pick<DbConfig, "allowMutations" | "allowedMutations" | "allowedMutationTargets">,
58
+ ): boolean {
59
+ return (
60
+ !config.allowMutations &&
61
+ config.allowedMutations.length === 0 &&
62
+ Object.keys(config.allowedMutationTargets).length === 0
63
+ );
64
+ }
65
+
56
66
  // Re-exported from the shared probe so existing `#db/service` consumers keep working.
57
67
  export { buildApiProbeArgs } from "#shared/k8s-probe";
58
68
 
@@ -393,6 +403,9 @@ export class DbService extends Context.Service<
393
403
  env: {
394
404
  ...process.env,
395
405
  ...(password ? { PGPASSWORD: password } : {}),
406
+ ...(isFullyReadOnly(config)
407
+ ? { PGOPTIONS: "-c default_transaction_read_only=on" }
408
+ : {}),
396
409
  } as Record<string, string>,
397
410
  });
398
411
  };