@blogic-cz/agent-tools 0.2.5 → 0.2.7

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
@@ -24,7 +24,7 @@ These tools wrap each CLI with:
24
24
  ### Manual installation
25
25
 
26
26
  ```bash
27
- bun add @blogic-cz/agent-tools
27
+ bun add -d @blogic-cz/agent-tools
28
28
  ```
29
29
 
30
30
  **Requirements:** [Bun](https://bun.sh/) >=1.0.0
@@ -75,6 +75,22 @@ bunx agent-tools-gh pr review-triage # interactive summary of PR feedback
75
75
  bunx agent-tools-k8s pods --env test # list pods (structured command)
76
76
  ```
77
77
 
78
+ Optionally, add script aliases to your `package.json` for shorter invocation:
79
+
80
+ ```json
81
+ {
82
+ "scripts": {
83
+ "gh-tool": "agent-tools-gh",
84
+ "k8s-tool": "agent-tools-k8s",
85
+ "db-tool": "agent-tools-db",
86
+ "logs-tool": "agent-tools-logs",
87
+ "session-tool": "agent-tools-session"
88
+ }
89
+ }
90
+ ```
91
+
92
+ Then run via `bun run k8s-tool -- pods --env test` instead of `bunx agent-tools-k8s pods --env test`.
93
+
78
94
  4. Hook up the credential guard in your agent config (Claude Code, OpenCode, etc.):
79
95
 
80
96
  ```typescript
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@blogic-cz/agent-tools",
3
- "version": "0.2.5",
3
+ "version": "0.2.7",
4
4
  "description": "CLI tools for AI coding agent workflows — GitHub, database, Kubernetes, Azure DevOps, logs, and sessions",
5
5
  "keywords": [
6
6
  "agent",
@@ -389,8 +389,8 @@ export function createCredentialGuard(config?: CredentialGuardConfig): Credentia
389
389
  throw new Error(
390
390
  `\u{1F6AB} Direct ${blockedTool.name} usage blocked.\n\n` +
391
391
  `AI agents must use wrapper tools for security and audit.\n\n` +
392
- `Use instead: ${blockedTool.wrapper}\n\n` +
393
- `Run with --help for documentation.\n\n` +
392
+ `Use instead: bun ${blockedTool.wrapper}\n\n` +
393
+ `Example: bun ${blockedTool.wrapper} --help\n\n` +
394
394
  `Think this tool should be allowed? See https://github.com/blogic-cz/agent-tools — fork, extend the whitelist, and submit a PR.`,
395
395
  );
396
396
  }
@@ -449,7 +449,14 @@ export const fetchChecks = Effect.fn("pr.fetchChecks")(function* (
449
449
  return yield* gh.runGhJson<CheckResult[]>([...args, "--json", "name,state,bucket,link"]);
450
450
  }
451
451
 
452
- return yield* gh.runGhJson<CheckResult[]>([...args, "--json", "name,state,bucket,link"]);
452
+ const results = yield* gh.runGhJson<CheckResult[]>([...args, "--json", "name,state,bucket,link"]);
453
+ if (results.some((c) => c.bucket === "pending")) {
454
+ yield* Console.warn(
455
+ `ℹ️ Some checks are still running. Prefer --watch to block until completion instead of polling:\n` +
456
+ ` bun agent-tools-gh pr checks${pr !== null ? ` --pr ${pr}` : ""} --watch`,
457
+ );
458
+ }
459
+ return results;
453
460
  });
454
461
 
455
462
  export const fetchFailedChecks = Effect.fn("pr.fetchFailedChecks")(function* (pr: number | null) {
@@ -68,8 +68,10 @@ export function isKubectlCommandAllowed(cmd: string): K8sSecurityCheckResult {
68
68
  const kubectlPart = trimmed.split("|")[0].trim();
69
69
 
70
70
  // Extract verb: first non-flag word
71
- const words = kubectlPart.split(/\s+/).filter((w) => !w.startsWith("-"));
72
- const verb = words[0]?.toLowerCase();
71
+ const verb = kubectlPart
72
+ .split(/\s+/)
73
+ .find((word) => !word.startsWith("-"))
74
+ ?.toLowerCase();
73
75
 
74
76
  if (!verb) {
75
77
  return { allowed: false, command: cmd, reason: "Empty kubectl command." };
@@ -32,12 +32,10 @@ const formatError = (error: unknown): string => {
32
32
  };
33
33
 
34
34
  const formatCause = (cause: Cause.Cause<unknown>): string => {
35
- const failures = cause.reasons.filter(Cause.isFailReason);
36
- const firstFailure = failures[0];
35
+ const firstFailure = cause.reasons.find(Cause.isFailReason);
37
36
  if (firstFailure !== undefined) return formatError(firstFailure.error);
38
37
 
39
- const defects = cause.reasons.filter(Cause.isDieReason);
40
- const firstDefect = defects[0];
38
+ const firstDefect = cause.reasons.find(Cause.isDieReason);
41
39
  if (firstDefect !== undefined) {
42
40
  if (firstDefect.defect instanceof Error)
43
41
  return `Unexpected error: ${firstDefect.defect.message}`;