@blogic-cz/agent-tools 0.15.14 → 0.17.0

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 (209) hide show
  1. package/README.md +5 -0
  2. package/dist/audit-tool/index.d.ts +3 -0
  3. package/dist/audit-tool/index.d.ts.map +1 -0
  4. package/dist/az-tool/build.d.ts +47 -0
  5. package/dist/az-tool/build.d.ts.map +1 -0
  6. package/dist/az-tool/config.d.ts +13 -0
  7. package/dist/az-tool/config.d.ts.map +1 -0
  8. package/dist/az-tool/errors.d.ts +43 -0
  9. package/dist/az-tool/errors.d.ts.map +1 -0
  10. package/dist/az-tool/extract-option-value.d.ts +2 -0
  11. package/dist/az-tool/extract-option-value.d.ts.map +1 -0
  12. package/dist/az-tool/index.d.ts +3 -0
  13. package/dist/az-tool/index.d.ts.map +1 -0
  14. package/dist/az-tool/security.d.ts +4 -0
  15. package/dist/az-tool/security.d.ts.map +1 -0
  16. package/dist/az-tool/service.d.ts +15 -0
  17. package/dist/az-tool/service.d.ts.map +1 -0
  18. package/dist/az-tool/transformers.d.ts +10 -0
  19. package/dist/az-tool/transformers.d.ts.map +1 -0
  20. package/dist/az-tool/types.d.ts +64 -0
  21. package/dist/az-tool/types.d.ts.map +1 -0
  22. package/dist/config/index.d.ts +4 -0
  23. package/dist/config/index.d.ts.map +1 -0
  24. package/dist/config/loader.d.ts +22 -0
  25. package/dist/config/loader.d.ts.map +1 -0
  26. package/dist/config/types.d.ts +189 -0
  27. package/dist/config/types.d.ts.map +1 -0
  28. package/dist/credential-guard/claude-hook.d.ts +13 -0
  29. package/dist/credential-guard/claude-hook.d.ts.map +1 -0
  30. package/dist/credential-guard/index.d.ts +77 -0
  31. package/dist/credential-guard/index.d.ts.map +1 -0
  32. package/dist/db-tool/config-service.d.ts +25 -0
  33. package/dist/db-tool/config-service.d.ts.map +1 -0
  34. package/dist/db-tool/errors.d.ts +41 -0
  35. package/dist/db-tool/errors.d.ts.map +1 -0
  36. package/dist/db-tool/index.d.ts +3 -0
  37. package/dist/db-tool/index.d.ts.map +1 -0
  38. package/dist/db-tool/schema.d.ts +21 -0
  39. package/dist/db-tool/schema.d.ts.map +1 -0
  40. package/dist/db-tool/security.d.ts +23 -0
  41. package/dist/db-tool/security.d.ts.map +1 -0
  42. package/dist/db-tool/service.d.ts +18 -0
  43. package/dist/db-tool/service.d.ts.map +1 -0
  44. package/dist/db-tool/sql-client.d.ts +24 -0
  45. package/dist/db-tool/sql-client.d.ts.map +1 -0
  46. package/dist/db-tool/transformers.d.ts +10 -0
  47. package/dist/db-tool/transformers.d.ts.map +1 -0
  48. package/dist/db-tool/types.d.ts +37 -0
  49. package/dist/db-tool/types.d.ts.map +1 -0
  50. package/dist/gh-tool/branch.d.ts +18 -0
  51. package/dist/gh-tool/branch.d.ts.map +1 -0
  52. package/dist/gh-tool/config.d.ts +7 -0
  53. package/dist/gh-tool/config.d.ts.map +1 -0
  54. package/dist/gh-tool/errors.d.ts +51 -0
  55. package/dist/gh-tool/errors.d.ts.map +1 -0
  56. package/dist/gh-tool/index.d.ts +3 -0
  57. package/dist/gh-tool/index.d.ts.map +1 -0
  58. package/dist/gh-tool/issue/commands.d.ts +68 -0
  59. package/dist/gh-tool/issue/commands.d.ts.map +1 -0
  60. package/dist/gh-tool/issue/core.d.ts +82 -0
  61. package/dist/gh-tool/issue/core.d.ts.map +1 -0
  62. package/dist/gh-tool/issue/index.d.ts +3 -0
  63. package/dist/gh-tool/issue/index.d.ts.map +1 -0
  64. package/dist/gh-tool/issue/triage.d.ts +89 -0
  65. package/dist/gh-tool/issue/triage.d.ts.map +1 -0
  66. package/dist/gh-tool/pr/commands.d.ts +384 -0
  67. package/dist/gh-tool/pr/commands.d.ts.map +1 -0
  68. package/dist/gh-tool/pr/core.d.ts +236 -0
  69. package/dist/gh-tool/pr/core.d.ts.map +1 -0
  70. package/dist/gh-tool/pr/helpers.d.ts +27 -0
  71. package/dist/gh-tool/pr/helpers.d.ts.map +1 -0
  72. package/dist/gh-tool/pr/index.d.ts +2 -0
  73. package/dist/gh-tool/pr/index.d.ts.map +1 -0
  74. package/dist/gh-tool/pr/review.d.ts +90 -0
  75. package/dist/gh-tool/pr/review.d.ts.map +1 -0
  76. package/dist/gh-tool/release.d.ts +52 -0
  77. package/dist/gh-tool/release.d.ts.map +1 -0
  78. package/dist/gh-tool/repo.d.ts +21 -0
  79. package/dist/gh-tool/repo.d.ts.map +1 -0
  80. package/dist/gh-tool/service.d.ts +25 -0
  81. package/dist/gh-tool/service.d.ts.map +1 -0
  82. package/dist/gh-tool/text-input.d.ts +22 -0
  83. package/dist/gh-tool/text-input.d.ts.map +1 -0
  84. package/dist/gh-tool/types.d.ts +271 -0
  85. package/dist/gh-tool/types.d.ts.map +1 -0
  86. package/dist/gh-tool/workflow.d.ts +157 -0
  87. package/dist/gh-tool/workflow.d.ts.map +1 -0
  88. package/dist/index.d.ts +4 -0
  89. package/dist/index.d.ts.map +1 -0
  90. package/dist/k8s-tool/errors.d.ts +43 -0
  91. package/dist/k8s-tool/errors.d.ts.map +1 -0
  92. package/dist/k8s-tool/index.d.ts +3 -0
  93. package/dist/k8s-tool/index.d.ts.map +1 -0
  94. package/dist/k8s-tool/profile.d.ts +3 -0
  95. package/dist/k8s-tool/profile.d.ts.map +1 -0
  96. package/dist/k8s-tool/security.d.ts +14 -0
  97. package/dist/k8s-tool/security.d.ts.map +1 -0
  98. package/dist/k8s-tool/service.d.ts +16 -0
  99. package/dist/k8s-tool/service.d.ts.map +1 -0
  100. package/dist/k8s-tool/transformers.d.ts +23 -0
  101. package/dist/k8s-tool/transformers.d.ts.map +1 -0
  102. package/dist/k8s-tool/types.d.ts +13 -0
  103. package/dist/k8s-tool/types.d.ts.map +1 -0
  104. package/dist/logs-tool/errors.d.ts +40 -0
  105. package/dist/logs-tool/errors.d.ts.map +1 -0
  106. package/dist/logs-tool/index.d.ts +21 -0
  107. package/dist/logs-tool/index.d.ts.map +1 -0
  108. package/dist/logs-tool/service.d.ts +23 -0
  109. package/dist/logs-tool/service.d.ts.map +1 -0
  110. package/dist/logs-tool/transformers.d.ts +2 -0
  111. package/dist/logs-tool/transformers.d.ts.map +1 -0
  112. package/dist/logs-tool/types.d.ts +39 -0
  113. package/dist/logs-tool/types.d.ts.map +1 -0
  114. package/dist/observability-tool/errors.d.ts +8 -0
  115. package/dist/observability-tool/errors.d.ts.map +1 -0
  116. package/dist/observability-tool/index.d.ts +3 -0
  117. package/dist/observability-tool/index.d.ts.map +1 -0
  118. package/dist/observability-tool/logs.d.ts +22 -0
  119. package/dist/observability-tool/logs.d.ts.map +1 -0
  120. package/dist/observability-tool/metrics.d.ts +3 -0
  121. package/dist/observability-tool/metrics.d.ts.map +1 -0
  122. package/dist/observability-tool/shared.d.ts +18 -0
  123. package/dist/observability-tool/shared.d.ts.map +1 -0
  124. package/dist/observability-tool/trace.d.ts +3 -0
  125. package/dist/observability-tool/trace.d.ts.map +1 -0
  126. package/dist/observability-tool/types.d.ts +171 -0
  127. package/dist/observability-tool/types.d.ts.map +1 -0
  128. package/dist/session-tool/claude-code.d.ts +46 -0
  129. package/dist/session-tool/claude-code.d.ts.map +1 -0
  130. package/dist/session-tool/codex.d.ts +44 -0
  131. package/dist/session-tool/codex.d.ts.map +1 -0
  132. package/dist/session-tool/config.d.ts +29 -0
  133. package/dist/session-tool/config.d.ts.map +1 -0
  134. package/dist/session-tool/errors.d.ts +27 -0
  135. package/dist/session-tool/errors.d.ts.map +1 -0
  136. package/dist/session-tool/index.d.ts +13 -0
  137. package/dist/session-tool/index.d.ts.map +1 -0
  138. package/dist/session-tool/pi.d.ts +40 -0
  139. package/dist/session-tool/pi.d.ts.map +1 -0
  140. package/dist/session-tool/service.d.ts +18 -0
  141. package/dist/session-tool/service.d.ts.map +1 -0
  142. package/dist/session-tool/summaries.d.ts +5 -0
  143. package/dist/session-tool/summaries.d.ts.map +1 -0
  144. package/dist/session-tool/types.d.ts +38 -0
  145. package/dist/session-tool/types.d.ts.map +1 -0
  146. package/dist/shared/audit.d.ts +40 -0
  147. package/dist/shared/audit.d.ts.map +1 -0
  148. package/dist/shared/binary-preflight.d.ts +27 -0
  149. package/dist/shared/binary-preflight.d.ts.map +1 -0
  150. package/dist/shared/bun.d.ts +5 -0
  151. package/dist/shared/bun.d.ts.map +1 -0
  152. package/dist/shared/cli.d.ts +18 -0
  153. package/dist/shared/cli.d.ts.map +1 -0
  154. package/dist/shared/env-template.d.ts +9 -0
  155. package/dist/shared/env-template.d.ts.map +1 -0
  156. package/dist/shared/error-renderer.d.ts +4 -0
  157. package/dist/shared/error-renderer.d.ts.map +1 -0
  158. package/dist/shared/exec.d.ts +23 -0
  159. package/dist/shared/exec.d.ts.map +1 -0
  160. package/dist/shared/format.d.ts +7 -0
  161. package/dist/shared/format.d.ts.map +1 -0
  162. package/dist/shared/index.d.ts +12 -0
  163. package/dist/shared/index.d.ts.map +1 -0
  164. package/dist/shared/k8s-probe.d.ts +11 -0
  165. package/dist/shared/k8s-probe.d.ts.map +1 -0
  166. package/dist/shared/log-transform.d.ts +2 -0
  167. package/dist/shared/log-transform.d.ts.map +1 -0
  168. package/dist/shared/path.d.ts +2 -0
  169. package/dist/shared/path.d.ts.map +1 -0
  170. package/dist/shared/prerequisites/config.d.ts +6 -0
  171. package/dist/shared/prerequisites/config.d.ts.map +1 -0
  172. package/dist/shared/prerequisites/driver-commands.d.ts +19 -0
  173. package/dist/shared/prerequisites/driver-commands.d.ts.map +1 -0
  174. package/dist/shared/prerequisites/errors.d.ts +10 -0
  175. package/dist/shared/prerequisites/errors.d.ts.map +1 -0
  176. package/dist/shared/prerequisites/guardian-entry.d.ts +2 -0
  177. package/dist/shared/prerequisites/guardian-entry.d.ts.map +1 -0
  178. package/dist/shared/prerequisites/guardian.d.ts +41 -0
  179. package/dist/shared/prerequisites/guardian.d.ts.map +1 -0
  180. package/dist/shared/prerequisites/index.d.ts +6 -0
  181. package/dist/shared/prerequisites/index.d.ts.map +1 -0
  182. package/dist/shared/prerequisites/runtime.d.ts +26 -0
  183. package/dist/shared/prerequisites/runtime.d.ts.map +1 -0
  184. package/dist/shared/prerequisites/store.d.ts +99 -0
  185. package/dist/shared/prerequisites/store.d.ts.map +1 -0
  186. package/dist/shared/prerequisites/types.d.ts +39 -0
  187. package/dist/shared/prerequisites/types.d.ts.map +1 -0
  188. package/dist/shared/prerequisites/vpn.d.ts +5 -0
  189. package/dist/shared/prerequisites/vpn.d.ts.map +1 -0
  190. package/dist/shared/schema-dump.d.ts +27 -0
  191. package/dist/shared/schema-dump.d.ts.map +1 -0
  192. package/dist/shared/throttle.d.ts +17 -0
  193. package/dist/shared/throttle.d.ts.map +1 -0
  194. package/dist/shared/transform.d.ts +49 -0
  195. package/dist/shared/transform.d.ts.map +1 -0
  196. package/dist/shared/types.d.ts +30 -0
  197. package/dist/shared/types.d.ts.map +1 -0
  198. package/package.json +85 -25
  199. package/src/az-tool/errors.ts +4 -4
  200. package/src/db-tool/errors.ts +4 -4
  201. package/src/gh-tool/errors.ts +11 -14
  202. package/src/k8s-tool/errors.ts +4 -4
  203. package/src/logs-tool/errors.ts +11 -14
  204. package/src/observability-tool/errors.ts +1 -1
  205. package/src/session-tool/errors.ts +7 -10
  206. package/src/shared/env-template.ts +1 -1
  207. package/src/shared/exec.ts +1 -1
  208. package/src/shared/prerequisites/errors.ts +1 -1
  209. package/src/shared/throttle.ts +1 -1
package/README.md CHANGED
@@ -27,6 +27,11 @@ These tools wrap each CLI with:
27
27
  bun add -d @blogic-cz/agent-tools
28
28
  ```
29
29
 
30
+ `effect` is a peer dependency pinned to an exact version, and package managers install
31
+ it for you. If your project depends on `effect` too, pin it to the same exact version.
32
+ Two copies of `effect` are structurally incompatible types, so the values this package
33
+ exports stop typechecking in your project when the versions drift.
34
+
30
35
  ### Skill installation
31
36
 
32
37
  Install per-tool skills for only the tools your project uses:
@@ -0,0 +1,3 @@
1
+ #!/usr/bin/env bun
2
+ export {};
3
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/audit-tool/index.ts"],"names":[],"mappings":""}
@@ -0,0 +1,47 @@
1
+ import { Effect } from "effect";
2
+ import type { BuildJob, BuildLogs, BuildTimeline, JobSummary, PipelineRun } from "./types";
3
+ import { AzParseError } from "./errors";
4
+ import { AzService } from "./service";
5
+ /**
6
+ * Get build timeline with all records (jobs, stages, tasks, etc.)
7
+ */
8
+ export declare const getBuildTimeline: (buildId: number) => Effect.Effect<BuildTimeline, import("./errors").AzSecurityError | import("./errors").AzCommandError | import("./errors").AzTimeoutError | AzParseError, AzService>;
9
+ /**
10
+ * Get jobs and stages from build timeline
11
+ */
12
+ export declare const getBuildJobs: (buildId: number) => Effect.Effect<{
13
+ jobs: BuildJob[];
14
+ stages: BuildJob[];
15
+ }, import("./errors").AzSecurityError | import("./errors").AzCommandError | import("./errors").AzTimeoutError | AzParseError, AzService>;
16
+ /**
17
+ * Get list of build logs
18
+ */
19
+ export declare const getBuildLogs: (buildId: number) => Effect.Effect<BuildLogs, import("./errors").AzSecurityError | import("./errors").AzCommandError | import("./errors").AzTimeoutError | AzParseError, AzService>;
20
+ /**
21
+ * Get specific log content by log ID
22
+ */
23
+ export declare const getBuildLogContent: (buildId: number, logId: number) => Effect.Effect<string, import("./errors").AzSecurityError | import("./errors").AzCommandError | import("./errors").AzTimeoutError | AzParseError, AzService>;
24
+ /**
25
+ * Get job summaries with duration and status information
26
+ */
27
+ export declare const getBuildJobSummary: (buildId: number) => Effect.Effect<JobSummary[], import("./errors").AzSecurityError | import("./errors").AzCommandError | import("./errors").AzTimeoutError | AzParseError, AzService>;
28
+ /**
29
+ * Find failed or canceled jobs in a build
30
+ */
31
+ export declare const findFailedJobs: (buildId: number) => Effect.Effect<{
32
+ id: string;
33
+ name: string;
34
+ result: "succeeded" | "failed" | "canceled" | "skipped" | null | undefined;
35
+ errorCount: number;
36
+ warningCount: number;
37
+ logId: number | undefined;
38
+ }[], import("./errors").AzSecurityError | import("./errors").AzCommandError | import("./errors").AzTimeoutError | AzParseError, AzService>;
39
+ /**
40
+ * List pipeline runs with optional filters
41
+ */
42
+ export declare const listPipelineRuns: (options?: {
43
+ branch?: string;
44
+ pipelineId?: number;
45
+ top?: number;
46
+ } | undefined) => Effect.Effect<PipelineRun[], import("./errors").AzSecurityError | import("./errors").AzCommandError | import("./errors").AzTimeoutError | AzParseError, AzService>;
47
+ //# sourceMappingURL=build.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"build.d.ts","sourceRoot":"","sources":["../../src/az-tool/build.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAU,MAAM,QAAQ,CAAC;AAExC,OAAO,KAAK,EAAE,QAAQ,EAAE,SAAS,EAAE,aAAa,EAAE,UAAU,EAAE,WAAW,EAAE,MAAM,SAAS,CAAC;AAE3F,OAAO,EAAE,YAAY,EAAE,MAAM,UAAU,CAAC;AACxC,OAAO,EAAE,SAAS,EAAE,MAAM,WAAW,CAAC;AAGtC;;GAEG;AACH,eAAO,MAAM,gBAAgB,yLAuD3B,CAAC;AAEH;;GAEG;AACH,eAAO,MAAM,YAAY;UAOP,QAAQ,EAAE;YACN,QAAQ,EAAE;wIAE9B,CAAC;AAEH;;GAEG;AACH,eAAO,MAAM,YAAY,qLAkCvB,CAAC;AAEH;;GAEG;AACH,eAAO,MAAM,kBAAkB,iMAwC7B,CAAC;AAEH;;GAEG;AACH,eAAO,MAAM,kBAAkB,wLAgC7B,CAAC;AAEH;;GAEG;AACH,eAAO,MAAM,cAAc;;;;;;;0IAazB,CAAC;AAEH;;GAEG;AACH,eAAO,MAAM,gBAAgB;aAClB,MAAM;iBACF,MAAM;UACb,MAAM;oLAwDZ,CAAC"}
@@ -0,0 +1,13 @@
1
+ export declare const ALLOWED_SUBCOMMANDS: readonly ["list", "run", "show", "show-tags"];
2
+ export declare const BLOCKED_SUBCOMMANDS: readonly ["create", "delete", "update", "cancel", "queue"];
3
+ export declare const DIRECT_AZ_COMMANDS: readonly ["pipelines", "repos"];
4
+ export declare const STANDALONE_AZ_COMMANDS: readonly ["acr", "account"];
5
+ export declare const ALLOWED_INVOKE_AREAS: readonly ["build"];
6
+ export declare const ALLOWED_INVOKE_RESOURCES: Record<string, readonly string[]>;
7
+ export declare const BLOCKED_INVOKE_AREAS: readonly ["git", "policy", "security", "wiki", "work", "graph", "audit", "permissions"];
8
+ export declare const BLOCKED_INVOKE_RESOURCES: Record<string, readonly string[]>;
9
+ export type AllowedSubcommand = (typeof ALLOWED_SUBCOMMANDS)[number];
10
+ export type BlockedSubcommand = (typeof BLOCKED_SUBCOMMANDS)[number];
11
+ export type AllowedInvokeArea = (typeof ALLOWED_INVOKE_AREAS)[number];
12
+ export type BlockedInvokeArea = (typeof BLOCKED_INVOKE_AREAS)[number];
13
+ //# sourceMappingURL=config.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../../src/az-tool/config.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,mBAAmB,+CAAgD,CAAC;AAEjF,eAAO,MAAM,mBAAmB,4DAA6D,CAAC;AAE9F,eAAO,MAAM,kBAAkB,iCAAkC,CAAC;AAElE,eAAO,MAAM,sBAAsB,6BAA8B,CAAC;AAElE,eAAO,MAAM,oBAAoB,oBAAqB,CAAC;AAEvD,eAAO,MAAM,wBAAwB,EAAE,MAAM,CAAC,MAAM,EAAE,SAAS,MAAM,EAAE,CAE7D,CAAC;AAEX,eAAO,MAAM,oBAAoB,yFASvB,CAAC;AAEX,eAAO,MAAM,wBAAwB,EAAE,MAAM,CAAC,MAAM,EAAE,SAAS,MAAM,EAAE,CAE7D,CAAC;AAEX,MAAM,MAAM,iBAAiB,GAAG,CAAC,OAAO,mBAAmB,CAAC,CAAC,MAAM,CAAC,CAAC;AACrE,MAAM,MAAM,iBAAiB,GAAG,CAAC,OAAO,mBAAmB,CAAC,CAAC,MAAM,CAAC,CAAC;AACrE,MAAM,MAAM,iBAAiB,GAAG,CAAC,OAAO,oBAAoB,CAAC,CAAC,MAAM,CAAC,CAAC;AACtE,MAAM,MAAM,iBAAiB,GAAG,CAAC,OAAO,oBAAoB,CAAC,CAAC,MAAM,CAAC,CAAC"}
@@ -0,0 +1,43 @@
1
+ import { Schema } from "effect";
2
+ declare const AzSecurityError_base: Schema.Class<AzSecurityError, Schema.TaggedStruct<"AzSecurityError", {
3
+ readonly message: Schema.String;
4
+ readonly command: Schema.String;
5
+ readonly hint: Schema.optionalKey<Schema.String>;
6
+ readonly nextCommand: Schema.optionalKey<Schema.String>;
7
+ readonly retryable: Schema.optionalKey<Schema.Boolean>;
8
+ }>, import("effect/Cause").YieldableError>;
9
+ export declare class AzSecurityError extends AzSecurityError_base {
10
+ }
11
+ declare const AzCommandError_base: Schema.Class<AzCommandError, Schema.TaggedStruct<"AzCommandError", {
12
+ readonly message: Schema.String;
13
+ readonly command: Schema.String;
14
+ readonly exitCode: Schema.optionalKey<Schema.Number>;
15
+ readonly stderr: Schema.optionalKey<Schema.String>;
16
+ readonly hint: Schema.optionalKey<Schema.String>;
17
+ readonly nextCommand: Schema.optionalKey<Schema.String>;
18
+ readonly retryable: Schema.optionalKey<Schema.Boolean>;
19
+ }>, import("effect/Cause").YieldableError>;
20
+ export declare class AzCommandError extends AzCommandError_base {
21
+ }
22
+ declare const AzTimeoutError_base: Schema.Class<AzTimeoutError, Schema.TaggedStruct<"AzTimeoutError", {
23
+ readonly message: Schema.String;
24
+ readonly command: Schema.String;
25
+ readonly timeoutMs: Schema.Number;
26
+ readonly hint: Schema.optionalKey<Schema.String>;
27
+ readonly nextCommand: Schema.optionalKey<Schema.String>;
28
+ readonly retryable: Schema.optionalKey<Schema.Boolean>;
29
+ }>, import("effect/Cause").YieldableError>;
30
+ export declare class AzTimeoutError extends AzTimeoutError_base {
31
+ }
32
+ declare const AzParseError_base: Schema.Class<AzParseError, Schema.TaggedStruct<"AzParseError", {
33
+ readonly message: Schema.String;
34
+ readonly rawOutput: Schema.String;
35
+ readonly hint: Schema.optionalKey<Schema.String>;
36
+ readonly nextCommand: Schema.optionalKey<Schema.String>;
37
+ readonly retryable: Schema.optionalKey<Schema.Boolean>;
38
+ }>, import("effect/Cause").YieldableError>;
39
+ export declare class AzParseError extends AzParseError_base {
40
+ }
41
+ export type AzError = AzSecurityError | AzCommandError | AzTimeoutError | AzParseError;
42
+ export {};
43
+ //# sourceMappingURL=errors.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"errors.d.ts","sourceRoot":"","sources":["../../src/az-tool/errors.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;;;;;;;;AAEhC,qBAAa,eAAgB,SAAQ,oBAMnC;CAAG;;;;;;;;;;AAEL,qBAAa,cAAe,SAAQ,mBAQlC;CAAG;;;;;;;;;AAEL,qBAAa,cAAe,SAAQ,mBAOlC;CAAG;;;;;;;;AAEL,qBAAa,YAAa,SAAQ,iBAMhC;CAAG;AAEL,MAAM,MAAM,OAAO,GAAG,eAAe,GAAG,cAAc,GAAG,cAAc,GAAG,YAAY,CAAC"}
@@ -0,0 +1,2 @@
1
+ export declare function extractOptionValue(args: readonly string[], optionName: string): string | undefined;
2
+ //# sourceMappingURL=extract-option-value.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"extract-option-value.d.ts","sourceRoot":"","sources":["../../src/az-tool/extract-option-value.ts"],"names":[],"mappings":"AAAA,wBAAgB,kBAAkB,CAChC,IAAI,EAAE,SAAS,MAAM,EAAE,EACvB,UAAU,EAAE,MAAM,GACjB,MAAM,GAAG,SAAS,CAQpB"}
@@ -0,0 +1,3 @@
1
+ #!/usr/bin/env bun
2
+ export {};
3
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/az-tool/index.ts"],"names":[],"mappings":""}
@@ -0,0 +1,4 @@
1
+ import type { InvokeParams, SecurityCheckResult } from "./types";
2
+ export declare function isCommandAllowed(cmd: string): SecurityCheckResult;
3
+ export declare function isInvokeAllowed(params: InvokeParams): SecurityCheckResult;
4
+ //# sourceMappingURL=security.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"security.d.ts","sourceRoot":"","sources":["../../src/az-tool/security.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,mBAAmB,EAAE,MAAM,SAAS,CAAC;AAYjE,wBAAgB,gBAAgB,CAAC,GAAG,EAAE,MAAM,GAAG,mBAAmB,CAiFjE;AAED,wBAAgB,eAAe,CAAC,MAAM,EAAE,YAAY,GAAG,mBAAmB,CAkCzE"}
@@ -0,0 +1,15 @@
1
+ import { ChildProcessSpawner } from "effect/unstable/process";
2
+ import { Context, Effect, Layer } from "effect";
3
+ import type { InvokeParams } from "./types";
4
+ import { AzSecurityError, AzCommandError, AzTimeoutError, AzParseError } from "./errors";
5
+ import { ConfigService } from "#config";
6
+ declare const AzService_base: Context.ServiceClass<AzService, "@agent-tools/AzService", {
7
+ readonly runCommand: (cmd: string, project?: string) => Effect.Effect<string, AzSecurityError | AzCommandError | AzTimeoutError | AzParseError>;
8
+ readonly runInvoke: (params: InvokeParams) => Effect.Effect<unknown, AzSecurityError | AzCommandError | AzTimeoutError | AzParseError>;
9
+ }>;
10
+ export declare class AzService extends AzService_base {
11
+ static readonly layer: Layer.Layer<AzService, never, ConfigService | ChildProcessSpawner.ChildProcessSpawner>;
12
+ }
13
+ export declare const AzServiceLayer: Layer.Layer<AzService, never, ConfigService | ChildProcessSpawner.ChildProcessSpawner>;
14
+ export {};
15
+ //# sourceMappingURL=service.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"service.d.ts","sourceRoot":"","sources":["../../src/az-tool/service.ts"],"names":[],"mappings":"AAAA,OAAO,EAAgB,mBAAmB,EAAE,MAAM,yBAAyB,CAAC;AAC5E,OAAO,EAAE,OAAO,EAAE,MAAM,EAAE,KAAK,EAAkB,MAAM,QAAQ,CAAC;AAEhE,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AAI5C,OAAO,EAAE,eAAe,EAAE,cAAc,EAAE,cAAc,EAAE,YAAY,EAAE,MAAM,UAAU,CAAC;AAGzF,OAAO,EAAE,aAAa,EAAiB,MAAM,SAAS,CAAC;;yBAK9B,CACnB,GAAG,EAAE,MAAM,EACX,OAAO,CAAC,EAAE,MAAM,KACb,MAAM,CAAC,MAAM,CAAC,MAAM,EAAE,eAAe,GAAG,cAAc,GAAG,cAAc,GAAG,YAAY,CAAC;wBACxE,CAClB,MAAM,EAAE,YAAY,KACjB,MAAM,CAAC,MAAM,CAAC,OAAO,EAAE,eAAe,GAAG,cAAc,GAAG,cAAc,GAAG,YAAY,CAAC;;AATjG,qBAAa,SAAU,SAAQ,cAWF;IAC3B,MAAM,CAAC,QAAQ,CAAC,KAAK,yFA6MnB;CACH;AAED,eAAO,MAAM,cAAc,wFAAkB,CAAC"}
@@ -0,0 +1,10 @@
1
+ import type { BuildJob } from "./types";
2
+ type ParsedTable = {
3
+ headers: string[];
4
+ rows: Record<string, string>[];
5
+ };
6
+ export declare function transformBuildLogContent(rawLog: string): string;
7
+ export declare function transformCmdOutput(rawOutput: string): string | Record<string, unknown> | unknown[] | ParsedTable;
8
+ export declare function transformTimeline(records: BuildJob[]): BuildJob[];
9
+ export {};
10
+ //# sourceMappingURL=transformers.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"transformers.d.ts","sourceRoot":"","sources":["../../src/az-tool/transformers.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC;AAExC,KAAK,WAAW,GAAG;IACjB,OAAO,EAAE,MAAM,EAAE,CAAC;IAClB,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,EAAE,CAAC;CAChC,CAAC;AAwCF,wBAAgB,wBAAwB,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,CAoC/D;AAED,wBAAgB,kBAAkB,CAChC,SAAS,EAAE,MAAM,GAChB,MAAM,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,OAAO,EAAE,GAAG,WAAW,CA6B5D;AAED,wBAAgB,iBAAiB,CAAC,OAAO,EAAE,QAAQ,EAAE,GAAG,QAAQ,EAAE,CAQjE"}
@@ -0,0 +1,64 @@
1
+ export type SecurityCheckResult = {
2
+ allowed: boolean;
3
+ command?: string;
4
+ reason?: string;
5
+ };
6
+ export type InvokeParams = {
7
+ area: string;
8
+ resource: string;
9
+ project?: string;
10
+ routeParameters?: Record<string, string | number>;
11
+ queryParameters?: Record<string, string | number>;
12
+ };
13
+ export type BuildJob = {
14
+ id: string;
15
+ parentId?: string | null;
16
+ type: "Job" | "Stage" | "Task" | "Phase" | "Checkpoint";
17
+ name: string;
18
+ state: "pending" | "inProgress" | "completed";
19
+ result?: "succeeded" | "failed" | "canceled" | "skipped" | null;
20
+ startTime?: string | null;
21
+ finishTime?: string | null;
22
+ errorCount?: number | null;
23
+ warningCount?: number | null;
24
+ log?: {
25
+ id: number;
26
+ url: string;
27
+ } | null;
28
+ };
29
+ export type BuildTimeline = {
30
+ records: BuildJob[];
31
+ id: string;
32
+ changeId: number;
33
+ lastChangedBy: string;
34
+ lastChangedOn: string;
35
+ url: string;
36
+ };
37
+ export type BuildLog = {
38
+ id: number;
39
+ type: string;
40
+ url: string;
41
+ lineCount?: number;
42
+ };
43
+ export type BuildLogs = {
44
+ count: number;
45
+ value: BuildLog[];
46
+ };
47
+ export type JobSummary = {
48
+ name: string;
49
+ state: string;
50
+ result?: string;
51
+ stage?: string;
52
+ duration?: string;
53
+ logId?: number;
54
+ };
55
+ export type PipelineRun = {
56
+ id: number;
57
+ buildNumber: string;
58
+ status: string;
59
+ result?: string;
60
+ sourceBranch: string;
61
+ startTime?: string;
62
+ finishTime?: string;
63
+ };
64
+ //# sourceMappingURL=types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"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AE,CAAC;IACpB,EAAE,EAAE,MAAM,CAAC;IACX,QAAQ,EAAE,MAAM,CAAC;IACjB,aAAa,EAAE,MAAM,CAAC;IACtB,aAAa,EAAE,MAAM,CAAC;IACtB,GAAG,EAAE,MAAM,CAAC;CACb,CAAC;AAEF,MAAM,MAAM,QAAQ,GAAG;IACrB,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,CAAC;IACb,GAAG,EAAE,MAAM,CAAC;IACZ,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB,CAAC;AAEF,MAAM,MAAM,SAAS,GAAG;IACtB,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,QAAQ,EAAE,CAAC;CACnB,CAAC;AAEF,MAAM,MAAM,UAAU,GAAG;IACvB,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB,CAAC;AAEF,MAAM,MAAM,WAAW,GAAG;IACxB,EAAE,EAAE,MAAM,CAAC;IACX,WAAW,EAAE,MAAM,CAAC;IACpB,MAAM,EAAE,MAAM,CAAC;IACf,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,YAAY,EAAE,MAAM,CAAC;IACrB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB,CAAC"}
@@ -0,0 +1,4 @@
1
+ export type { AgentToolsConfig, AzureConfig, K8sConfig, DbEnvConfig, DbAllowedMutationTargets, DbMutationOperation, DatabaseConfig, ObservabilityConfig, ObservabilityEnvTarget, LogsConfig, AuditConfig, CliToolOverride, CredentialGuardConfig, GitHubPrTitlePolicy, GitHubRepoConfig, } from "./types";
2
+ export { DbMutationOperationSchema } from "./types";
3
+ export { ConfigService, ConfigServiceLayer, getToolConfig, getDefaultEnvironment, getGitHubConfig, resolveGitHubRepoTarget, loadConfig, } from "./loader";
4
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/config/index.ts"],"names":[],"mappings":"AAAA,YAAY,EACV,gBAAgB,EAChB,WAAW,EACX,SAAS,EACT,WAAW,EACX,wBAAwB,EACxB,mBAAmB,EACnB,cAAc,EACd,mBAAmB,EACnB,sBAAsB,EACtB,UAAU,EACV,WAAW,EACX,eAAe,EACf,qBAAqB,EACrB,mBAAmB,EACnB,gBAAgB,GACjB,MAAM,SAAS,CAAC;AAEjB,OAAO,EAAE,yBAAyB,EAAE,MAAM,SAAS,CAAC;AAEpD,OAAO,EACL,aAAa,EACb,kBAAkB,EAClB,aAAa,EACb,qBAAqB,EACrB,eAAe,EACf,uBAAuB,EACvB,UAAU,GACX,MAAM,UAAU,CAAC"}
@@ -0,0 +1,22 @@
1
+ import { Context, Layer } from "effect";
2
+ import type { AgentToolsConfig, GitHubRepoConfig } from "./types";
3
+ export declare function decodeConfig(parsed: unknown, configPath?: string): AgentToolsConfig;
4
+ export declare function loadConfig(): Promise<AgentToolsConfig | undefined>;
5
+ declare const ConfigService_base: Context.ServiceClass<ConfigService, "@agent-tools/ConfigService", AgentToolsConfig | undefined>;
6
+ export declare class ConfigService extends ConfigService_base {
7
+ }
8
+ declare const ConfigLoadError_base: new <A extends Record<string, any> = {}>(args: import("effect/Types").VoidIfEmpty<{ readonly [P in keyof A as P extends "_tag" ? never : P]: A[P]; }>) => import("effect/Cause").YieldableError & {
9
+ readonly _tag: "ConfigLoadError";
10
+ } & Readonly<A>;
11
+ export declare class ConfigLoadError extends ConfigLoadError_base<{
12
+ readonly cause: unknown;
13
+ }> {
14
+ }
15
+ export declare const ConfigServiceLayer: Layer.Layer<ConfigService, ConfigLoadError, never>;
16
+ type ProfiledSection = keyof Pick<AgentToolsConfig, "azure" | "kubernetes" | "database" | "observability" | "logs">;
17
+ export declare function getToolConfig<T>(config: AgentToolsConfig | undefined, section: ProfiledSection, profile?: string): T | undefined;
18
+ export declare function getDefaultEnvironment(config: AgentToolsConfig | undefined): string | undefined;
19
+ export declare function getGitHubConfig(config: AgentToolsConfig | undefined, profile?: string): GitHubRepoConfig | undefined;
20
+ export declare function resolveGitHubRepoTarget(config: AgentToolsConfig | undefined, target?: string | null): string | undefined;
21
+ export {};
22
+ //# sourceMappingURL=loader.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"loader.d.ts","sourceRoot":"","sources":["../../src/config/loader.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,OAAO,EAAgB,KAAK,EAAU,MAAM,QAAQ,CAAC;AAE9D,OAAO,KAAK,EAAE,gBAAgB,EAAE,gBAAgB,EAAE,MAAM,SAAS,CAAC;AA2NlE,wBAAgB,YAAY,CAC1B,MAAM,EAAE,OAAO,EACf,UAAU,GAAE,MAA4B,GACvC,gBAAgB,CAmClB;AAmFD,wBAAsB,UAAU,IAAI,OAAO,CAAC,gBAAgB,GAAG,SAAS,CAAC,CAcxE;;AAED,qBAAa,aAAc,SAAQ,kBAElC;CAAG;;;;AAEJ,qBAAa,eAAgB,SAAQ,qBAAoC;IACvE,QAAQ,CAAC,KAAK,EAAE,OAAO,CAAC;CACzB,CAAC;CAAG;AAEL,eAAO,MAAM,kBAAkB,oDAM9B,CAAC;AAEF,KAAK,eAAe,GAAG,MAAM,IAAI,CAC/B,gBAAgB,EAChB,OAAO,GAAG,YAAY,GAAG,UAAU,GAAG,eAAe,GAAG,MAAM,CAC/D,CAAC;AAEF,wBAAgB,aAAa,CAAC,CAAC,EAC7B,MAAM,EAAE,gBAAgB,GAAG,SAAS,EACpC,OAAO,EAAE,eAAe,EACxB,OAAO,CAAC,EAAE,MAAM,GACf,CAAC,GAAG,SAAS,CAkCf;AAED,wBAAgB,qBAAqB,CAAC,MAAM,EAAE,gBAAgB,GAAG,SAAS,GAAG,MAAM,GAAG,SAAS,CAE9F;AAED,wBAAgB,eAAe,CAC7B,MAAM,EAAE,gBAAgB,GAAG,SAAS,EACpC,OAAO,CAAC,EAAE,MAAM,GACf,gBAAgB,GAAG,SAAS,CAc9B;AAED,wBAAgB,uBAAuB,CACrC,MAAM,EAAE,gBAAgB,GAAG,SAAS,EACpC,MAAM,CAAC,EAAE,MAAM,GAAG,IAAI,GACrB,MAAM,GAAG,SAAS,CAqBpB"}
@@ -0,0 +1,189 @@
1
+ import { Schema } from "effect";
2
+ /** Azure DevOps profile configuration */
3
+ export type AzureConfig = {
4
+ organization: string;
5
+ defaultProject: string;
6
+ timeoutMs?: number;
7
+ };
8
+ export type CleanupPolicy = "leave-running" | "stop-if-started";
9
+ export type VpnPrerequisite = {
10
+ type: "vpn";
11
+ key: string;
12
+ cleanup?: CleanupPolicy;
13
+ };
14
+ export type MacosScutilVpnDriverConfig = {
15
+ type: "macos-scutil";
16
+ serviceName?: string;
17
+ /** Name of environment variable holding the IPSec shared secret for scutil --nc start. */
18
+ secretEnvVar?: string;
19
+ };
20
+ export type LinuxNmcliVpnDriverConfig = {
21
+ type: "linux-nmcli";
22
+ connectionName?: string;
23
+ };
24
+ export type WindowsRasdialVpnDriverConfig = {
25
+ type: "windows-rasdial";
26
+ entryName?: string;
27
+ };
28
+ export type VpnDriverConfig = MacosScutilVpnDriverConfig | LinuxNmcliVpnDriverConfig | WindowsRasdialVpnDriverConfig;
29
+ export type VpnConfig = {
30
+ name: string;
31
+ /** Defaults to true. Auto maps name to the current OS driver deterministically. */
32
+ auto?: boolean;
33
+ defaultCleanup?: CleanupPolicy;
34
+ connectTimeoutMs?: number;
35
+ /** Total bounded stop-and-confirm window in milliseconds. */
36
+ disconnectTimeoutMs?: number;
37
+ /** Managed VPN reuse window after the last lease. Defaults to 30000; 0 disconnects immediately. */
38
+ idleDisconnectMs?: number;
39
+ /** Name of environment variable holding the VPN shared secret for supported drivers. */
40
+ secretEnvVar?: string;
41
+ drivers?: {
42
+ darwin?: MacosScutilVpnDriverConfig;
43
+ linux?: LinuxNmcliVpnDriverConfig;
44
+ win32?: WindowsRasdialVpnDriverConfig;
45
+ };
46
+ /** Explicit current-platform driver, required when auto is false and no per-OS driver is available. */
47
+ driver?: VpnDriverConfig;
48
+ };
49
+ export type ProfilePrerequisites = {
50
+ prerequisites?: readonly VpnPrerequisite[];
51
+ /** Convenience input sugar; normalize to prerequisites before execution. */
52
+ vpn?: string;
53
+ };
54
+ /** Kubernetes cluster profile configuration */
55
+ export type K8sConfig = ProfilePrerequisites & {
56
+ /** Optional kubeconfig path. Supports ${ENV_VAR} templates. */
57
+ kubeconfig?: string;
58
+ clusterId: string;
59
+ /** Named namespaces, e.g. { test: "my-app-test", prod: "my-app-prod" } */
60
+ namespaces: Record<string, string>;
61
+ timeoutMs?: number;
62
+ /**
63
+ * Timeout in milliseconds for the cheap Kubernetes API-server reachability probe run
64
+ * before each command. When the cluster API is unreachable (VPN down / off the office
65
+ * network, or the API degraded) a real kubectl command hangs until `timeoutMs`; the
66
+ * probe lets it fail fast with a clear message instead. Set to 0 to disable. Defaults to 2000.
67
+ */
68
+ apiProbeTimeoutMs?: number;
69
+ };
70
+ /** Single database environment connection details */
71
+ export type DbEnvConfig = ProfilePrerequisites & {
72
+ host: string;
73
+ port: number;
74
+ user: string;
75
+ database: string;
76
+ /** Plain-text password for local development. Prefer passwordEnvVar for non-local environments. */
77
+ password?: string;
78
+ /** Name of environment variable holding the password, e.g. "DB_TEST_PWD" */
79
+ passwordEnvVar?: string;
80
+ };
81
+ /** SQL mutation operation that can be explicitly allowed for a database environment. */
82
+ export declare const DbMutationOperationSchema: Schema.Literals<readonly ["insert", "update", "delete"]>;
83
+ export type DbMutationOperation = Schema.Schema.Type<typeof DbMutationOperationSchema>;
84
+ export type DbAllowedMutationTargets = Partial<Record<DbMutationOperation, readonly string[]>>;
85
+ /** Database profile configuration */
86
+ export type DatabaseConfig = ProfilePrerequisites & {
87
+ /** Named database environments, e.g. { local: {...}, test: {...}, prod: {...} } */
88
+ environments: Record<string, DbEnvConfig>;
89
+ /** Explicitly allowed SQL mutation operations per environment. Non-local environments default to read-only. */
90
+ allowedMutations?: Record<string, readonly DbMutationOperation[]>;
91
+ allowedMutationTargets?: Record<string, DbAllowedMutationTargets>;
92
+ kubectl?: {
93
+ /** Optional kubeconfig path. Supports ${ENV_VAR} templates. */
94
+ kubeconfig?: string;
95
+ context: string;
96
+ namespace: string;
97
+ service?: string;
98
+ };
99
+ tunnelTimeoutMs?: number;
100
+ /**
101
+ * Timeout in milliseconds for the cheap Kubernetes API-server reachability probe
102
+ * run before attempting a tunnel. When the API server is unreachable (VPN down and
103
+ * not on the office network) `kubectl port-forward` hangs silently on TCP connect, so
104
+ * a short probe lets the direct (no-VPN) attempt fail fast and fall back to connecting
105
+ * the VPN instead of waiting out `tunnelTimeoutMs`. Set to 0 to disable the probe.
106
+ * Defaults to 2000.
107
+ */
108
+ apiProbeTimeoutMs?: number;
109
+ remotePort?: number;
110
+ };
111
+ /** Logs profile configuration */
112
+ export type LogsConfig = ProfilePrerequisites & {
113
+ localDir: string;
114
+ remotePath: string;
115
+ kubernetesProfile?: string;
116
+ };
117
+ /** Single observability environment connection details */
118
+ export type ObservabilityEnvTarget = {
119
+ url: string;
120
+ tokenEnvVar?: string;
121
+ prometheusUid?: string;
122
+ lokiUid?: string;
123
+ };
124
+ /** Observability profile configuration */
125
+ export type ObservabilityConfig = {
126
+ environments: Record<string, ObservabilityEnvTarget>;
127
+ };
128
+ export type CliToolOverride = {
129
+ tool: string;
130
+ suggestion: string;
131
+ };
132
+ /** Credential guard config - merged with built-in defaults */
133
+ export type CredentialGuardConfig = {
134
+ additionalBlockedPaths?: string[];
135
+ additionalAllowedPaths?: string[];
136
+ additionalBlockedCliTools?: CliToolOverride[];
137
+ additionalDangerousBashPatterns?: string[];
138
+ };
139
+ export type AuditConfig = {
140
+ retentionDays?: number;
141
+ dbPath?: string;
142
+ };
143
+ /** Single GitHub repository configuration */
144
+ export type GitHubPrTitlePolicy = {
145
+ pattern: string;
146
+ expected: string;
147
+ example?: string;
148
+ };
149
+ export type GitHubRepoConfig = {
150
+ owner: string;
151
+ repo: string;
152
+ prTitle?: GitHubPrTitlePolicy;
153
+ };
154
+ /**
155
+ * Root agent-tools configuration.
156
+ *
157
+ * Each tool section (azure, kubernetes, database, logs) is a Record<string, ToolConfig>
158
+ * of named profiles. Tools select a profile via the --profile <name> flag (default = "default" key).
159
+ * If only one profile exists, it is used automatically.
160
+ *
161
+ * session, credentialGuard, and audit are global - not per-profile.
162
+ */
163
+ export type AgentToolsConfig = {
164
+ $schema?: string;
165
+ /** Named Azure DevOps profiles. e.g. { default: { organization: "...", defaultProject: "..." } } */
166
+ azure?: Record<string, AzureConfig>;
167
+ /** Named VPN definitions referenced by profile prerequisites. */
168
+ vpns?: Record<string, VpnConfig>;
169
+ /** Named Kubernetes cluster profiles. e.g. { default: {...}, staging: {...} } */
170
+ kubernetes?: Record<string, K8sConfig>;
171
+ /** Named database profiles. e.g. { default: {...}, analytics: {...} } */
172
+ database?: Record<string, DatabaseConfig>;
173
+ /** Named logs profiles. e.g. { default: { localDir: "...", remotePath: "..." } } */
174
+ logs?: Record<string, LogsConfig>;
175
+ /** Named observability profiles. e.g. { default: { environments: { local: {...}, prod: {...} } } } */
176
+ observability?: Record<string, ObservabilityConfig>;
177
+ /** Global session config (not per-profile) */
178
+ session?: {
179
+ storagePath: string;
180
+ };
181
+ audit?: AuditConfig;
182
+ /** Global credential guard config (merged with built-in defaults, not per-profile) */
183
+ credentialGuard?: CredentialGuardConfig;
184
+ /** Optional default environment name (local|test|prod) used by tools when no --env flag is provided */
185
+ defaultEnvironment?: string;
186
+ /** Named GitHub repository profiles. e.g. { default: { owner: "...", repo: "..." } } */
187
+ github?: Record<string, GitHubRepoConfig>;
188
+ };
189
+ //# sourceMappingURL=types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/config/types.ts"],"names":[],"mappings":"AAAA,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AE;QACR,WAAW,EAAE,MAAM,CAAC;KACrB,CAAC;IACF,KAAK,CAAC,EAAE,WAAW,CAAC;IACpB,sFAAsF;IACtF,eAAe,CAAC,EAAE,qBAAqB,CAAC;IACxC,uGAAuG;IACvG,kBAAkB,CAAC,EAAE,MAAM,CAAC;IAC5B,wFAAwF;IACxF,MAAM,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,gBAAgB,CAAC,CAAC;CAC3C,CAAC"}
@@ -0,0 +1,13 @@
1
+ #!/usr/bin/env bun
2
+ /**
3
+ * Claude Code PreToolUse hook wrapper.
4
+ *
5
+ * Reads JSON from stdin (Claude Code hook protocol), runs the credential guard,
6
+ * and exits with code 2 + stderr message if blocked, or 0 if allowed.
7
+ *
8
+ * Usage in .claude/settings.json:
9
+ * { "hooks": { "PreToolUse": [{ "matcher": ".*", "hooks": [{ "type": "command",
10
+ * "command": "bun node_modules/@blogic-cz/agent-tools/src/credential-guard/claude-hook.ts" }] }] } }
11
+ */
12
+ export {};
13
+ //# sourceMappingURL=claude-hook.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"claude-hook.d.ts","sourceRoot":"","sources":["../../src/credential-guard/claude-hook.ts"],"names":[],"mappings":";AACA;;;;;;;;;GASG"}
@@ -0,0 +1,77 @@
1
+ /**
2
+ * Credential Guard
3
+ *
4
+ * Security patterns and functions for detecting sensitive files and secrets.
5
+ * Used by AI coding agent hooks/plugins.
6
+ *
7
+ * Security layers:
8
+ * 1. Path-based blocking (files that should never be read)
9
+ * 2. Content scanning (detect secrets in write operations)
10
+ * 3. Dangerous bash command detection
11
+ * 4. CLI tool blocking (must use wrapper tools)
12
+ *
13
+ * Note: This is a convenience layer. Real security should be enforced
14
+ * at infrastructure level (K8s RBAC, file permissions, etc.)
15
+ */
16
+ import type { CredentialGuardConfig } from "#config/types";
17
+ /** Input format received by hooks/plugins. */
18
+ export type HookInput = {
19
+ tool: string;
20
+ };
21
+ /** Output format received by hooks/plugins. */
22
+ export type HookOutput = {
23
+ args: Record<string, unknown>;
24
+ };
25
+ /** Object returned by createCredentialGuard */
26
+ export type CredentialGuard = {
27
+ handleToolExecuteBefore: (input: HookInput, output: HookOutput) => void;
28
+ detectSecrets: (content: string) => {
29
+ name: string;
30
+ match: string;
31
+ } | null;
32
+ isPathAllowed: (filePath: string) => boolean;
33
+ isPathBlocked: (filePath: string) => boolean;
34
+ isDangerousBashCommand: (command: string) => boolean;
35
+ getBlockedCliTool: (command: string) => {
36
+ name: string;
37
+ wrapper: string;
38
+ } | null;
39
+ isGhCommandAllowed: (command: string) => boolean;
40
+ detectSleepPolling: (command: string) => string | null;
41
+ };
42
+ /** Extract file path from hook arguments. */
43
+ export declare function extractFilePath(args: Record<string, unknown>): string;
44
+ /** Extract content from hook arguments. */
45
+ export declare function extractContent(args: Record<string, unknown>): string;
46
+ /** Extract command from hook arguments. */
47
+ export declare function extractCommand(args: Record<string, unknown>): string;
48
+ /**
49
+ * Create a credential guard with optional extra patterns merged into defaults.
50
+ *
51
+ * @param config - Optional overrides. Arrays are concatenated with defaults (not replaced).
52
+ * @returns Object with all guard functions bound to the merged pattern sets.
53
+ */
54
+ export declare function createCredentialGuard(config?: CredentialGuardConfig): CredentialGuard;
55
+ /** Handle tool execution with default guard (no extra config). */
56
+ export declare const handleToolExecuteBefore: (input: HookInput, output: HookOutput) => void;
57
+ /** Detect secrets in content with default guard. */
58
+ export declare const detectSecrets: (content: string) => {
59
+ name: string;
60
+ match: string;
61
+ } | null;
62
+ /** Check if a path is in the allowed exceptions list (default guard). */
63
+ export declare const isPathAllowed: (filePath: string) => boolean;
64
+ /** Check if a path should be blocked (default guard). */
65
+ export declare const isPathBlocked: (filePath: string) => boolean;
66
+ /** Check if a bash command might expose secrets (default guard). */
67
+ export declare const isDangerousBashCommand: (command: string) => boolean;
68
+ /** Get blocked CLI tool info (default guard). */
69
+ export declare const getBlockedCliTool: (command: string) => {
70
+ name: string;
71
+ wrapper: string;
72
+ } | null;
73
+ /** Check if a gh command is allowed (default guard). */
74
+ export declare const isGhCommandAllowed: (command: string) => boolean;
75
+ /** Detect sleep-polling with agent-tools wrapper commands (default guard). */
76
+ export declare const detectSleepPolling: (command: string) => string | null;
77
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/credential-guard/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,KAAK,EAAmB,qBAAqB,EAAE,MAAM,eAAe,CAAC;AAM5E,8CAA8C;AAC9C,MAAM,MAAM,SAAS,GAAG;IACtB,IAAI,EAAE,MAAM,CAAC;CACd,CAAC;AAEF,+CAA+C;AAC/C,MAAM,MAAM,UAAU,GAAG;IACvB,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CAC/B,CAAC;AAQF,+CAA+C;AAC/C,MAAM,MAAM,eAAe,GAAG;IAC5B,uBAAuB,EAAE,CAAC,KAAK,EAAE,SAAS,EAAE,MAAM,EAAE,UAAU,KAAK,IAAI,CAAC;IACxE,aAAa,EAAE,CAAC,OAAO,EAAE,MAAM,KAAK;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,MAAM,CAAA;KAAE,GAAG,IAAI,CAAC;IAC3E,aAAa,EAAE,CAAC,QAAQ,EAAE,MAAM,KAAK,OAAO,CAAC;IAC7C,aAAa,EAAE,CAAC,QAAQ,EAAE,MAAM,KAAK,OAAO,CAAC;IAC7C,sBAAsB,EAAE,CAAC,OAAO,EAAE,MAAM,KAAK,OAAO,CAAC;IACrD,iBAAiB,EAAE,CAAC,OAAO,EAAE,MAAM,KAAK;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,OAAO,EAAE,MAAM,CAAA;KAAE,GAAG,IAAI,CAAC;IACjF,kBAAkB,EAAE,CAAC,OAAO,EAAE,MAAM,KAAK,OAAO,CAAC;IACjD,kBAAkB,EAAE,CAAC,OAAO,EAAE,MAAM,K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