@blogic-cz/agent-tools 0.18.1 → 1.1.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 (75) hide show
  1. package/README.md +35 -6
  2. package/dist/az-tool/config.d.ts +60 -12
  3. package/dist/az-tool/config.d.ts.map +1 -1
  4. package/dist/az-tool/errors.d.ts +10 -1
  5. package/dist/az-tool/errors.d.ts.map +1 -1
  6. package/dist/az-tool/profile.d.ts +16 -0
  7. package/dist/az-tool/profile.d.ts.map +1 -0
  8. package/dist/az-tool/security.d.ts +20 -3
  9. package/dist/az-tool/security.d.ts.map +1 -1
  10. package/dist/az-tool/service.d.ts +9 -4
  11. package/dist/az-tool/service.d.ts.map +1 -1
  12. package/dist/az-tool/types.d.ts +10 -60
  13. package/dist/az-tool/types.d.ts.map +1 -1
  14. package/dist/{az-tool → azdo-tool}/build.d.ts +9 -9
  15. package/dist/azdo-tool/build.d.ts.map +1 -0
  16. package/dist/azdo-tool/config.d.ts +13 -0
  17. package/dist/azdo-tool/config.d.ts.map +1 -0
  18. package/dist/azdo-tool/errors.d.ts +43 -0
  19. package/dist/azdo-tool/errors.d.ts.map +1 -0
  20. package/dist/azdo-tool/extract-option-value.d.ts.map +1 -0
  21. package/dist/azdo-tool/index.d.ts +3 -0
  22. package/dist/azdo-tool/index.d.ts.map +1 -0
  23. package/dist/azdo-tool/security.d.ts +4 -0
  24. package/dist/azdo-tool/security.d.ts.map +1 -0
  25. package/dist/azdo-tool/service.d.ts +15 -0
  26. package/dist/azdo-tool/service.d.ts.map +1 -0
  27. package/dist/azdo-tool/transformers.d.ts.map +1 -0
  28. package/dist/azdo-tool/types.d.ts +64 -0
  29. package/dist/azdo-tool/types.d.ts.map +1 -0
  30. package/dist/config/index.d.ts +1 -1
  31. package/dist/config/index.d.ts.map +1 -1
  32. package/dist/config/loader.d.ts +1 -1
  33. package/dist/config/loader.d.ts.map +1 -1
  34. package/dist/config/types.d.ts +18 -1
  35. package/dist/config/types.d.ts.map +1 -1
  36. package/dist/credential-guard/index.d.ts.map +1 -1
  37. package/dist/gh-tool/gist.d.ts +102 -0
  38. package/dist/gh-tool/gist.d.ts.map +1 -0
  39. package/dist/gh-tool/text-input.d.ts +1 -0
  40. package/dist/gh-tool/text-input.d.ts.map +1 -1
  41. package/dist/shared/azure-credentials.d.ts +20 -0
  42. package/dist/shared/azure-credentials.d.ts.map +1 -0
  43. package/dist/shared/binary-preflight.d.ts +1 -1
  44. package/package.json +8 -2
  45. package/schemas/agent-tools.schema.json +42 -1
  46. package/src/az-tool/config.ts +135 -25
  47. package/src/az-tool/errors.ts +14 -1
  48. package/src/az-tool/index.ts +67 -134
  49. package/src/az-tool/profile.ts +48 -0
  50. package/src/az-tool/security.ts +248 -89
  51. package/src/az-tool/service.ts +137 -242
  52. package/src/az-tool/types.ts +11 -64
  53. package/src/{az-tool → azdo-tool}/build.ts +11 -11
  54. package/src/azdo-tool/config.ts +33 -0
  55. package/src/azdo-tool/errors.ts +41 -0
  56. package/src/azdo-tool/index.ts +222 -0
  57. package/src/azdo-tool/security.ts +157 -0
  58. package/src/azdo-tool/service.ts +322 -0
  59. package/src/azdo-tool/types.ts +67 -0
  60. package/src/config/index.ts +1 -0
  61. package/src/config/loader.ts +10 -1
  62. package/src/config/types.ts +19 -1
  63. package/src/credential-guard/index.ts +7 -2
  64. package/src/gh-tool/gist.ts +625 -0
  65. package/src/gh-tool/index.ts +21 -1
  66. package/src/gh-tool/text-input.ts +10 -2
  67. package/src/shared/azure-credentials.ts +50 -0
  68. package/src/shared/binary-preflight.ts +1 -1
  69. package/dist/az-tool/build.d.ts.map +0 -1
  70. package/dist/az-tool/extract-option-value.d.ts.map +0 -1
  71. package/dist/az-tool/transformers.d.ts.map +0 -1
  72. /package/dist/{az-tool → azdo-tool}/extract-option-value.d.ts +0 -0
  73. /package/dist/{az-tool → azdo-tool}/transformers.d.ts +0 -0
  74. /package/src/{az-tool → azdo-tool}/extract-option-value.ts +0 -0
  75. /package/src/{az-tool → azdo-tool}/transformers.ts +0 -0
package/README.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # @blogic-cz/agent-tools
2
2
 
3
- Safe CLI wrappers for AI coding agents. 8 tools for GitHub, observability, databases, Kubernetes, Azure DevOps, logs, OpenCode sessions, and audit history — with JSON5 config and a credential guard that blocks agents from touching secrets.
3
+ Safe CLI wrappers for AI coding agents. 9 tools for GitHub, observability, databases, Kubernetes, Azure platform, Azure DevOps, logs, OpenCode sessions, and audit history — with JSON5 config and a credential guard that blocks agents from touching secrets.
4
4
 
5
5
  ## Why
6
6
 
@@ -42,6 +42,7 @@ npx skills add blogic-cz/agent-tools --path skills/observability-tool
42
42
  npx skills add blogic-cz/agent-tools --path skills/db-tool
43
43
  npx skills add blogic-cz/agent-tools --path skills/k8s-tool
44
44
  npx skills add blogic-cz/agent-tools --path skills/az-tool
45
+ npx skills add blogic-cz/agent-tools --path skills/azdo-tool
45
46
  npx skills add blogic-cz/agent-tools --path skills/logs-tool
46
47
  npx skills add blogic-cz/agent-tools --path skills/session-tool
47
48
  ```
@@ -109,6 +110,7 @@ npx skills add blogic-cz/agent-tools --path skills/observability-tool
109
110
  npx skills add blogic-cz/agent-tools --path skills/db-tool
110
111
  npx skills add blogic-cz/agent-tools --path skills/k8s-tool
111
112
  npx skills add blogic-cz/agent-tools --path skills/az-tool
113
+ npx skills add blogic-cz/agent-tools --path skills/azdo-tool
112
114
  npx skills add blogic-cz/agent-tools --path skills/logs-tool
113
115
  npx skills add blogic-cz/agent-tools --path skills/session-tool
114
116
 
@@ -126,7 +128,8 @@ Available per-tool skills:
126
128
  | `observability-tool` | Tempo traces, Loki logs, Prometheus metrics |
127
129
  | `db-tool` | SQL queries, schema introspection |
128
130
  | `k8s-tool` | Kubernetes pods, logs, deployments |
129
- | `az-tool` | Azure DevOps pipelines, builds |
131
+ | `az-tool` | Azure VMs, web apps, storage, AKS, ACR |
132
+ | `azdo-tool` | Azure DevOps pipelines, builds |
130
133
  | `logs-tool` | Application log reading (local and remote) |
131
134
  | `session-tool` | OpenCode session history browsing |
132
135
  | `agent-tools` | All of the above in a single skill |
@@ -254,7 +257,8 @@ export default { handleToolExecuteBefore };
254
257
  | `audit-tool` | Audit trail browser — inspect recent tool invocations and purge old entries |
255
258
  | `db-tool` | Database query tool — SQL execution, schema introspection |
256
259
  | `k8s-tool` | Kubernetes tool — kubectl wrapper + structured commands (`pods`, `logs`, `describe`, `exec`, `top`) |
257
- | `az-tool` | Azure DevOps tool — pipelines, builds, repos |
260
+ | `az-tool` | Azure platform tool — read-only inspection of VMs, web apps, storage, AKS, ACR |
261
+ | `azdo-tool` | Azure DevOps tool — pipelines, builds, repos |
258
262
  | `logs-tool` | Application logs — read local and remote (k8s pod) logs |
259
263
  | `session-tool` | OpenCode session browser — list, read, search sessions |
260
264
 
@@ -266,6 +270,30 @@ All tools support `--help` for full usage documentation. Legacy `agent-tools-*`
266
270
 
267
271
  Pod `exec` is limited to direct `redis-cli PING/INFO` and `ls` diagnostics. Generic exec cannot read file contents; use `logs-tool`, which confines files to the configured log directory, tails them through an internal structured operation, and applies the same case-insensitive literal substring filter locally and remotely. Configured log directories are a trusted boundary and must not permit adversarial symlink replacement during reads.
268
272
 
273
+ ### Azure command safety
274
+
275
+ Azure is split across two binaries. `azdo-tool` covers Azure DevOps (`pipelines`, `repos`, `devops invoke`); `az-tool` covers the Azure platform (`vm`, `webapp`, `storage`, `aks`, `acr`, `monitor`, …). Sending a DevOps group to `az-tool` fails with a pointer to `azdo-tool` rather than running.
276
+
277
+ `az-tool` resolves the verb **positionally** — the last word before the first flag — so a flag value can never be read as a command. Only read-only verbs are allowed (`list`, `show`, `describe`, `exists`, `search`, `history`, `version`, `validate`, `wait`, plus the `list-`, `show-`, `check-`, and `get-` families); mutating verbs and unknown verbs are both rejected. Credential reads are blocked regardless of verb: the `get-access-token`/`get-credentials`/`list-keys`/`list-connection-strings`/`list-publishing-profiles` family, and any command whose group path contains `secret`, `secrets`, `key`, `keys`, `credential`, `credentials`, `appsettings`, `admin-key`, `query-key`, `sas`, `password`, or `connection-string` — for those the listing itself returns values (`storage account keys list`, `webapp config appsettings list`). Key Vault is narrower: `keyvault secret list`/`list-versions` return names and attributes and are allowed, `keyvault secret show` is not, and the `key`/`certificate` subgroups are allowed because they expose only public material. Shell syntax is rejected and commands are spawned as an argument vector, never through a shell.
278
+
279
+ The subscription comes from the `azurePlatform` config profile and is appended to every command; a user-supplied `--subscription` is rejected, and with no `azurePlatform` section the tool refuses to run rather than falling back to whatever `az login` last selected. The set of configured profiles is therefore the allowlist of reachable subscriptions.
280
+
281
+ Two optional scope guards sit on top. A profile keyed `prod`/`production`, or carrying `production: true`, cannot be reached through auto-selection or the `default` key — `--profile` must name it explicitly, mirroring `k8s-tool`'s refusal of implicit prod. And `allowedResourceGroups` rejects any command naming a group outside the list; an empty or absent list allows every group in the subscription. A group is recognised both from `-g`/`--resource-group` — every occurrence, since the Azure CLI is argparse-based and a repeated flag takes the last value — and from the `/resourceGroups/<name>` segment of a full ARM resource ID passed to a flag such as `--scope` or `--resource`. `--ids` is rejected outright because it carries its own subscription as well as its own resource group, side-stepping both guards. The resource-group check only fires when a command names a group, so subscription-wide reads such as `vm list` remain unrestricted — it guards against touching the wrong group, it does not partition the subscription.
282
+
283
+ `azdo-tool` keeps its allowlist of read-only operations (`list`, `run`, `show`, `show-tags`) and rejects `create`/`delete`/`update`/`cancel`/`queue` anywhere in the command. `run` is accepted only in the `pipelines` group — `acr run` and `acr task run` execute arbitrary commands in Azure and are blocked. The `acr` and `account` groups remain reachable from `azdo-tool` for backwards compatibility; new work should use `az-tool` for them. Because those two groups address the Azure platform rather than Azure DevOps, the platform credential rules apply to them here as well — `acr credential show` is refused by both tools. The verb and segment lists behind that live in `src/shared/azure-credentials.ts` so the two tools cannot drift apart.
284
+
285
+ ### Gist commands
286
+
287
+ ```bash
288
+ bun gh-tool gist list
289
+ bun gh-tool gist view --id <gist-id>
290
+ bun gh-tool gist create --body "snippet" --filename example.txt
291
+ bun gh-tool gist edit --id <gist-id> --body "updated" --filename example.txt
292
+ bun gh-tool gist delete --id <gist-id> --confirm
293
+ ```
294
+
295
+ Gists are secret by default. `gist delete` prints a dry run unless `--confirm` is passed. `gist edit` requires a content or mutation flag and never opens an editor.
296
+
269
297
  ### gh-tool machine contracts
270
298
 
271
299
  `pr view` adds `headSha` and `baseSha`; failed-check evidence adds the same SHA pair. Review summaries, inline comments, and threads add `commitSha` plus `feedbackOrigin`: `current_head` only for an exact `commitSha === headSha`, `pre_existing` for a different known SHA (not an obsolescence verdict), and `unknown` when either SHA is absent. Issue comments always use `commitSha: null` and `feedbackOrigin: unknown`. `review-triage` preserves existing fields and adds `inlineComments` plus per-kind `feedbackOriginCounts`; batch triage returns the same object per PR. `pr request-review --reviewers alice,bob` emits sorted `submittedReviewers` (normalized input), `newlyRequested` and `alreadyPending` (the submitted logins split by whether a pending request already existed, so a fresh re-request is distinguishable from a no-op), and `requestedReviewers` (GitHub-confirmed result). `pr last-human-reviewer` derives `currentRequestedReviewers` from live `reviewRequests` only; timeline events are not replayed because GitHub clears a pending request on review submit without emitting `ReviewRequestRemovedEvent`.
@@ -403,8 +431,8 @@ Each tool section supports multiple named profiles. Select with `--profile <name
403
431
  ```
404
432
 
405
433
  ```bash
406
- bun az-tool cmd --cmd "pipelines list" # uses "default" profile
407
- bun az-tool cmd --cmd "pipelines list" --profile legacy # uses "legacy" profile
434
+ bun azdo-tool cmd --cmd "pipelines list" # uses "default" profile
435
+ bun azdo-tool cmd --cmd "pipelines list" --profile legacy # uses "legacy" profile
408
436
  ```
409
437
 
410
438
  **Profile resolution:** `--profile` flag > auto-select (single profile) > `"default"` key > error.
@@ -422,7 +450,8 @@ Each tool uses its own auth method — no unified token store:
422
450
  | `gh-tool` | `gh` CLI session (`gh auth login`) or `GITHUB_TOKEN` env var |
423
451
  | `observability-tool` | Grafana URL from config plus optional token from `tokenEnvVar` |
424
452
  | `k8s-tool` | Existing kubectl context (kubeconfig). Cluster ID from config resolves context automatically |
425
- | `az-tool` | `az` CLI session (`az login`) |
453
+ | `az-tool` | `az` CLI session (`az login`). Subscription pinned by the `azurePlatform` config profile |
454
+ | `azdo-tool` | `az` CLI session (`az login`) |
426
455
  | `db-tool` | Password from env var defined by `passwordEnvVar` in config (e.g. `AGENT_TOOLS_DB_PASSWORD`) |
427
456
  | `logs-tool` | No auth — reads local files or uses k8s-tool for remote access |
428
457
 
@@ -1,13 +1,61 @@
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];
1
+ /** Command groups owned by azdo-tool. Routed there with a hint instead of being run here. */
2
+ export declare const AZURE_DEVOPS_GROUPS: readonly ["devops", "pipelines", "repos", "boards", "artifacts"];
3
+ /** Verbs that only read state, matched exactly against the command verb. */
4
+ export declare const READ_ONLY_VERBS: readonly ["list", "show", "describe", "exists", "search", "history", "version", "validate", "wait"];
5
+ /** Verb families that only read state, matched as a prefix of the command verb. */
6
+ export declare const READ_ONLY_VERB_PREFIXES: readonly ["list-", "show-", "check-", "get-"];
7
+ /**
8
+ * Mutating verbs. Unknown verbs are rejected anyway; this list exists so the
9
+ * common cases get "'delete' is a mutating operation" instead of "unknown verb".
10
+ */
11
+ export declare const BLOCKED_VERBS: readonly ["add", "apply", "approve", "assign", "attach", "browse", "cancel", "clear", "connect", "create", "delete", "deploy", "destroy", "detach", "disable", "down", "download", "enable", "execute", "failover", "generate", "grant", "import", "init", "install", "invoke", "login", "logout", "move", "patch", "publish", "prune", "purge", "regenerate", "reject", "remove", "renew", "repair", "replace", "reset", "restart", "restore", "revoke", "rotate", "run", "scale", "set", "ssh", "start", "stop", "swap", "sync", "tunnel", "unassign", "uninstall", "untag", "up", "update", "upgrade", "upload"];
12
+ /**
13
+ * Credential-bearing verbs and group segments live in `#shared` because
14
+ * azdo-tool's `acr`/`account` passthrough must refuse exactly the same
15
+ * commands. Re-exported here so this file stays the single place az-tool's
16
+ * security config is read from.
17
+ *
18
+ * Segment matching keeps neighbouring groups reachable: `keyvault list` works
19
+ * because the blocked segment is `secret`, not `keyvault`. Key Vault gets a
20
+ * further carve-out below.
21
+ */
22
+ export { CREDENTIAL_BLOCKED_SEGMENTS, CREDENTIAL_BLOCKED_VERBS } from "#shared/azure-credentials";
23
+ /** The Key Vault command group, which needs finer treatment than segment matching. */
24
+ export declare const KEYVAULT_GROUP = "keyvault";
25
+ /**
26
+ * Key Vault subgroups that expose public material only — a key's public JWK, a
27
+ * certificate's public half. The private halves live under `secret`, which
28
+ * stays gated. Without this, segment matching on `key` would block the whole
29
+ * `az keyvault key` surface for no gain.
30
+ */
31
+ export declare const KEYVAULT_PUBLIC_SUBGROUPS: readonly ["key", "certificate"];
32
+ /**
33
+ * Key Vault subgroups where listing is metadata-only but `show` returns the
34
+ * value. `az keyvault secret list` yields ids, attributes, and tags — no
35
+ * secret material — so the list family is allowed and `show` is not.
36
+ */
37
+ export declare const KEYVAULT_NAME_ONLY_SUBGROUPS: readonly ["secret", "secrets"];
38
+ /**
39
+ * Flags controlled by the selected profile. A user override would defeat the
40
+ * configured subscription pin, so they are rejected rather than forwarded.
41
+ */
42
+ export declare const CONTROLLED_FLAGS: readonly ["--subscription"];
43
+ /**
44
+ * Alternate addressing modes rejected outright. `--ids` takes a full ARM
45
+ * resource ID that carries its own subscription and resource group, so it
46
+ * side-steps both the subscription pin and the resource group allowlist.
47
+ * `-g` plus `--name` expresses the same target inside the guarded scope.
48
+ */
49
+ export declare const REJECTED_ADDRESSING_FLAGS: readonly ["--ids"];
50
+ /** Flags naming the resource group a command addresses. */
51
+ export declare const RESOURCE_GROUP_FLAGS: readonly ["-g", "--resource-group"];
52
+ /**
53
+ * The resource group segment of an ARM resource ID. Flags such as `--scope`
54
+ * and `--resource` take a full ID, naming a resource group without ever using
55
+ * -g, so IDs are mined for group names too.
56
+ */
57
+ export declare const RESOURCE_GROUP_IN_ID_PATTERN: RegExp;
58
+ export type ReadOnlyVerb = (typeof READ_ONLY_VERBS)[number];
59
+ export type BlockedVerb = (typeof BLOCKED_VERBS)[number];
60
+ export type AzureDevOpsGroup = (typeof AZURE_DEVOPS_GROUPS)[number];
13
61
  //# sourceMappingURL=config.d.ts.map
@@ -1 +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"}
1
+ {"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../../src/az-tool/config.ts"],"names":[],"mappings":"AAAA,6FAA6F;AAC7F,eAAO,MAAM,mBAAmB,kEAAmE,CAAC;AAEpG,4EAA4E;AAC5E,eAAO,MAAM,eAAe,qGAUlB,CAAC;AAEX,mFAAmF;AACnF,eAAO,MAAM,uBAAuB,+CAAgD,CAAC;AAErF;;;GAGG;AACH,eAAO,MAAM,aAAa,qlBA6DhB,CAAC;AAEX;;;;;;;;;GASG;AACH,OAAO,EAAE,2BAA2B,EAAE,wBAAwB,EAAE,MAAM,2BAA2B,CAAC;AAElG,sFAAsF;AACtF,eAAO,MAAM,cAAc,aAAa,CAAC;AAEzC;;;;;GAKG;AACH,eAAO,MAAM,yBAAyB,iCAAkC,CAAC;AAEzE;;;;GAIG;AACH,eAAO,MAAM,4BAA4B,gCAAiC,CAAC;AAE3E;;;GAGG;AACH,eAAO,MAAM,gBAAgB,6BAA8B,CAAC;AAE5D;;;;;GAKG;AACH,eAAO,MAAM,yBAAyB,oBAAqB,CAAC;AAE5D,2DAA2D;AAC3D,eAAO,MAAM,oBAAoB,qCAAsC,CAAC;AAExE;;;;GAIG;AACH,eAAO,MAAM,4BAA4B,QAAkC,CAAC;AAE5E,MAAM,MAAM,YAAY,GAAG,CAAC,OAAO,eAAe,CAAC,CAAC,MAAM,CAAC,CAAC;AAC5D,MAAM,MAAM,WAAW,GAAG,CAAC,OAAO,aAAa,CAAC,CAAC,MAAM,CAAC,CAAC;AACzD,MAAM,MAAM,gBAAgB,GAAG,CAAC,OAAO,mBAAmB,CAAC,CAAC,MAAM,CAAC,CAAC"}
@@ -29,6 +29,15 @@ declare const AzTimeoutError_base: Schema.Class<AzTimeoutError, Schema.TaggedStr
29
29
  }>, import("effect/Cause").YieldableError>;
30
30
  export declare class AzTimeoutError extends AzTimeoutError_base {
31
31
  }
32
+ declare const AzProfileError_base: Schema.Class<AzProfileError, Schema.TaggedStruct<"AzProfileError", {
33
+ readonly message: Schema.String;
34
+ readonly profile: 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 AzProfileError extends AzProfileError_base {
40
+ }
32
41
  declare const AzParseError_base: Schema.Class<AzParseError, Schema.TaggedStruct<"AzParseError", {
33
42
  readonly message: Schema.String;
34
43
  readonly rawOutput: Schema.String;
@@ -38,6 +47,6 @@ declare const AzParseError_base: Schema.Class<AzParseError, Schema.TaggedStruct<
38
47
  }>, import("effect/Cause").YieldableError>;
39
48
  export declare class AzParseError extends AzParseError_base {
40
49
  }
41
- export type AzError = AzSecurityError | AzCommandError | AzTimeoutError | AzParseError;
50
+ export type AzError = AzSecurityError | AzCommandError | AzTimeoutError | AzParseError | AzProfileError;
42
51
  export {};
43
52
  //# sourceMappingURL=errors.d.ts.map
@@ -1 +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"}
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,cAAe,SAAQ,mBAMlC;CAAG;;;;;;;;AAEL,qBAAa,YAAa,SAAQ,iBAMhC;CAAG;AAEL,MAAM,MAAM,OAAO,GACf,eAAe,GACf,cAAc,GACd,cAAc,GACd,YAAY,GACZ,cAAc,CAAC"}
@@ -0,0 +1,16 @@
1
+ import type { AzurePlatformConfig } from "#config/types";
2
+ /** Profile keys treated as production unless the profile says otherwise. */
3
+ export declare const PRODUCTION_PROFILE_NAMES: readonly ["prod", "production"];
4
+ /**
5
+ * The profile key getToolConfig will resolve to, so callers can reason about
6
+ * which subscription they are about to touch. Mirrors getToolConfig's rules:
7
+ * explicit name wins, then a lone profile, then the "default" key.
8
+ */
9
+ export declare function selectAzProfileName(section: Record<string, unknown> | undefined, explicitProfile: string | undefined): string | undefined;
10
+ /**
11
+ * Production profiles require --profile to be named explicitly. An explicit
12
+ * `production` flag wins; otherwise the profile key carries the convention, so
13
+ * a profile keyed "prod" is guarded without extra configuration.
14
+ */
15
+ export declare function isProductionProfile(profileName: string | undefined, config: AzurePlatformConfig): boolean;
16
+ //# sourceMappingURL=profile.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"profile.d.ts","sourceRoot":"","sources":["../../src/az-tool/profile.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,eAAe,CAAC;AAEzD,4EAA4E;AAC5E,eAAO,MAAM,wBAAwB,iCAAkC,CAAC;AAExE;;;;GAIG;AACH,wBAAgB,mBAAmB,CACjC,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,SAAS,EAC5C,eAAe,EAAE,MAAM,GAAG,SAAS,GAClC,MAAM,GAAG,SAAS,CAepB;AAED;;;;GAIG;AACH,wBAAgB,mBAAmB,CACjC,WAAW,EAAE,MAAM,GAAG,SAAS,EAC/B,MAAM,EAAE,mBAAmB,GAC1B,OAAO,CAST"}
@@ -1,4 +1,21 @@
1
- import type { InvokeParams, SecurityCheckResult } from "./types";
2
- export declare function isCommandAllowed(cmd: string): SecurityCheckResult;
3
- export declare function isInvokeAllowed(params: InvokeParams): SecurityCheckResult;
1
+ import type { AzSecurityCheckOptions, AzSecurityCheckResult } from "./types";
2
+ /**
3
+ * Tokenize an az command line into argv. Returns undefined for anything
4
+ * carrying shell syntax, so a command can never expand, chain, or redirect.
5
+ * Quoted regions keep their contents verbatim, which leaves `--query
6
+ * "[?name=='web']"` usable.
7
+ */
8
+ export declare function parseAzCommand(cmd: string): string[] | undefined;
9
+ export declare function isReadOnlyVerb(verb: string): boolean;
10
+ /**
11
+ * Every resource group a command names via -g / --resource-group, in either the
12
+ * spaced or the `=` form. Empty when the command names none, which for
13
+ * subscription-wide reads like `vm list` is the normal case.
14
+ *
15
+ * All occurrences are collected, not just the first: the Azure CLI is argparse
16
+ * based, so a repeated flag silently takes the LAST value. Validating only the
17
+ * first would let `-g allowed -g denied` through while az ran against `denied`.
18
+ */
19
+ export declare function extractResourceGroups(argv: readonly string[]): string[];
20
+ export declare function isAzCommandAllowed(cmd: string, options?: AzSecurityCheckOptions): AzSecurityCheckResult;
4
21
  //# sourceMappingURL=security.d.ts.map
@@ -1 +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"}
1
+ {"version":3,"file":"security.d.ts","sourceRoot":"","sources":["../../src/az-tool/security.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,sBAAsB,EAAE,qBAAqB,EAAE,MAAM,SAAS,CAAC;AAkB7E;;;;;GAKG;AACH,wBAAgB,cAAc,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,EAAE,GAAG,SAAS,CAqChE;AAgBD,wBAAgB,cAAc,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAGpD;AAOD;;;;;;;;GAQG;AACH,wBAAgB,qBAAqB,CAAC,IAAI,EAAE,SAAS,MAAM,EAAE,GAAG,MAAM,EAAE,CAgCvE;AAqCD,wBAAgB,kBAAkB,CAChC,GAAG,EAAE,MAAM,EACX,OAAO,CAAC,EAAE,sBAAsB,GAC/B,qBAAqB,CAwHvB"}
@@ -1,11 +1,16 @@
1
1
  import { ChildProcessSpawner } from "effect/unstable/process";
2
2
  import { Context, Effect, Layer } from "effect";
3
- import type { InvokeParams } from "./types";
4
- import { AzSecurityError, AzCommandError, AzTimeoutError, AzParseError } from "./errors";
3
+ import type { AzParseError } from "./errors";
4
+ import { AzCommandError, AzProfileError, AzSecurityError, AzTimeoutError } from "./errors";
5
5
  import { ConfigService } from "#config";
6
+ export type AzCommandResult = {
7
+ readonly command: string;
8
+ readonly subscription: string | undefined;
9
+ readonly data: unknown;
10
+ };
6
11
  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>;
12
+ readonly runCommand: (cmd: string, profile?: string) => Effect.Effect<AzCommandResult, AzSecurityError | AzCommandError | AzTimeoutError | AzParseError | AzProfileError>;
13
+ readonly renderCommand: (cmd: string, profile?: string) => Effect.Effect<string, AzSecurityError | AzCommandError | AzProfileError>;
9
14
  }>;
10
15
  export declare class AzService extends AzService_base {
11
16
  static readonly layer: Layer.Layer<AzService, never, ConfigService | ChildProcessSpawner.ChildProcessSpawner>;
@@ -1 +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;;yBAM9B,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,yFAmNnB;CACH;AAED,eAAO,MAAM,cAAc,wFAAkB,CAAC"}
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;AAIhE,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,UAAU,CAAC;AAE7C,OAAO,EAAE,cAAc,EAAE,cAAc,EAAE,eAAe,EAAE,cAAc,EAAE,MAAM,UAAU,CAAC;AAG3F,OAAO,EAAE,aAAa,EAAiB,MAAM,SAAS,CAAC;AASvD,MAAM,MAAM,eAAe,GAAG;IAC5B,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;IACzB,QAAQ,CAAC,YAAY,EAAE,MAAM,GAAG,SAAS,CAAC;IAC1C,QAAQ,CAAC,IAAI,EAAE,OAAO,CAAC;CACxB,CAAC;;yBAKuB,CACnB,GAAG,EAAE,MAAM,EACX,OAAO,CAAC,EAAE,MAAM,KACb,MAAM,CAAC,MAAM,CAChB,eAAe,EACf,eAAe,GAAG,cAAc,GAAG,cAAc,GAAG,YAAY,GAAG,cAAc,CAClF;4BACuB,CACtB,GAAG,EAAE,MAAM,EACX,OAAO,CAAC,EAAE,MAAM,KACb,MAAM,CAAC,MAAM,CAAC,MAAM,EAAE,eAAe,GAAG,cAAc,GAAG,cAAc,CAAC;;AAbjF,qBAAa,SAAU,SAAQ,cAeF;IAC3B,MAAM,CAAC,QAAQ,CAAC,KAAK,yFAsKnB;CACH;AAED,eAAO,MAAM,cAAc,wFAAkB,CAAC"}
@@ -1,64 +1,14 @@
1
- export type SecurityCheckResult = {
1
+ export type AzSecurityCheckOptions = {
2
+ /** Empty or absent allows every resource group in the subscription. */
3
+ allowedResourceGroups?: readonly string[];
4
+ };
5
+ export type AzSecurityCheckResult = {
2
6
  allowed: boolean;
3
- command?: string;
7
+ command: string;
8
+ argv?: string[];
9
+ verb?: string;
10
+ resourceGroup?: string;
4
11
  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;
12
+ hint?: string;
63
13
  };
64
14
  //# sourceMappingURL=types.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/az-tool/types.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,mBAAmB,GAAG;IAChC,OAAO,EAAE,OAAO,CAAC;IACjB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB,CAAC;AAEF,MAAM,MAAM,YAAY,GAAG;IACzB,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,EAAE,MAAM,CAAC;IACjB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,eAAe,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,CAAC,CAAC;IAClD,eAAe,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,CAAC,CAAC;CACnD,CAAC;AAEF,MAAM,MAAM,QAAQ,GAAG;IACrB,EAAE,EAAE,MAAM,CAAC;IACX,QAAQ,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACzB,IAAI,EAAE,KAAK,GAAG,OAAO,GAAG,MAAM,GAAG,OAAO,GAAG,YAAY,CAAC;IACxD,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,SAAS,GAAG,YAAY,GAAG,WAAW,CAAC;IAC9C,MAAM,CAAC,EAAE,WAAW,GAAG,QAAQ,GAAG,UAAU,GAAG,SAAS,GAAG,IAAI,CAAC;IAChE,SAAS,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAC1B,UAAU,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAC3B,UAAU,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAC3B,YAAY,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAC7B,GAAG,CAAC,EAAE;QAAE,EAAE,EAAE,MAAM,CAAC;QAAC,GAAG,EAAE,MAAM,CAAA;KAAE,GAAG,IAAI,CAAC;CAC1C,CAAC;AAEF,MAAM,MAAM,aAAa,GAAG;IAC1B,OAAO,EAAE,QAAQ,EAAE,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"}
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/az-tool/types.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,sBAAsB,GAAG;IACnC,uEAAuE;IACvE,qBAAqB,CAAC,EAAE,SAAS,MAAM,EAAE,CAAC;CAC3C,CAAC;AAEF,MAAM,MAAM,qBAAqB,GAAG;IAClC,OAAO,EAAE,OAAO,CAAC;IACjB,OAAO,EAAE,MAAM,CAAC;IAChB,IAAI,CAAC,EAAE,MAAM,EAAE,CAAC;IAChB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,IAAI,CAAC,EAAE,MAAM,CAAC;CACf,CAAC"}
@@ -1,30 +1,30 @@
1
1
  import { Effect } from "effect";
2
2
  import type { BuildJob, BuildLogs, BuildTimeline, JobSummary, PipelineRun } from "./types";
3
- import { AzParseError } from "./errors";
4
- import { AzService } from "./service";
3
+ import { AzdoParseError } from "./errors";
4
+ import { AzdoService } from "./service";
5
5
  /**
6
6
  * Get build timeline with all records (jobs, stages, tasks, etc.)
7
7
  */
8
- export declare const getBuildTimeline: (buildId: number) => Effect.Effect<BuildTimeline, import("./errors").AzSecurityError | import("./errors").AzCommandError | import("./errors").AzTimeoutError | AzParseError, AzService>;
8
+ export declare const getBuildTimeline: (buildId: number) => Effect.Effect<BuildTimeline, import("./errors").AzdoSecurityError | import("./errors").AzdoCommandError | import("./errors").AzdoTimeoutError | AzdoParseError, AzdoService>;
9
9
  /**
10
10
  * Get jobs and stages from build timeline
11
11
  */
12
12
  export declare const getBuildJobs: (buildId: number) => Effect.Effect<{
13
13
  jobs: BuildJob[];
14
14
  stages: BuildJob[];
15
- }, import("./errors").AzSecurityError | import("./errors").AzCommandError | import("./errors").AzTimeoutError | AzParseError, AzService>;
15
+ }, import("./errors").AzdoSecurityError | import("./errors").AzdoCommandError | import("./errors").AzdoTimeoutError | AzdoParseError, AzdoService>;
16
16
  /**
17
17
  * Get list of build logs
18
18
  */
19
- export declare const getBuildLogs: (buildId: number) => Effect.Effect<BuildLogs, import("./errors").AzSecurityError | import("./errors").AzCommandError | import("./errors").AzTimeoutError | AzParseError, AzService>;
19
+ export declare const getBuildLogs: (buildId: number) => Effect.Effect<BuildLogs, import("./errors").AzdoSecurityError | import("./errors").AzdoCommandError | import("./errors").AzdoTimeoutError | AzdoParseError, AzdoService>;
20
20
  /**
21
21
  * Get specific log content by log ID
22
22
  */
23
- export declare const getBuildLogContent: (buildId: number, logId: number) => Effect.Effect<string, import("./errors").AzSecurityError | import("./errors").AzCommandError | import("./errors").AzTimeoutError | AzParseError, AzService>;
23
+ export declare const getBuildLogContent: (buildId: number, logId: number) => Effect.Effect<string, import("./errors").AzdoSecurityError | import("./errors").AzdoCommandError | import("./errors").AzdoTimeoutError | AzdoParseError, AzdoService>;
24
24
  /**
25
25
  * Get job summaries with duration and status information
26
26
  */
27
- export declare const getBuildJobSummary: (buildId: number) => Effect.Effect<JobSummary[], import("./errors").AzSecurityError | import("./errors").AzCommandError | import("./errors").AzTimeoutError | AzParseError, AzService>;
27
+ export declare const getBuildJobSummary: (buildId: number) => Effect.Effect<JobSummary[], import("./errors").AzdoSecurityError | import("./errors").AzdoCommandError | import("./errors").AzdoTimeoutError | AzdoParseError, AzdoService>;
28
28
  /**
29
29
  * Find failed or canceled jobs in a build
30
30
  */
@@ -35,7 +35,7 @@ export declare const findFailedJobs: (buildId: number) => Effect.Effect<{
35
35
  errorCount: number;
36
36
  warningCount: number;
37
37
  logId: number | undefined;
38
- }[], import("./errors").AzSecurityError | import("./errors").AzCommandError | import("./errors").AzTimeoutError | AzParseError, AzService>;
38
+ }[], import("./errors").AzdoSecurityError | import("./errors").AzdoCommandError | import("./errors").AzdoTimeoutError | AzdoParseError, AzdoService>;
39
39
  /**
40
40
  * List pipeline runs with optional filters
41
41
  */
@@ -43,5 +43,5 @@ export declare const listPipelineRuns: (options?: {
43
43
  branch?: string;
44
44
  pipelineId?: number;
45
45
  top?: number;
46
- } | undefined) => Effect.Effect<PipelineRun[], import("./errors").AzSecurityError | import("./errors").AzCommandError | import("./errors").AzTimeoutError | AzParseError, AzService>;
46
+ } | undefined) => Effect.Effect<PipelineRun[], import("./errors").AzdoSecurityError | import("./errors").AzdoCommandError | import("./errors").AzdoTimeoutError | AzdoParseError, AzdoService>;
47
47
  //# sourceMappingURL=build.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"build.d.ts","sourceRoot":"","sources":["../../src/azdo-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,cAAc,EAAE,MAAM,UAAU,CAAC;AAC1C,OAAO,EAAE,WAAW,EAAE,MAAM,WAAW,CAAC;AAGxC;;GAEG;AACH,eAAO,MAAM,gBAAgB,mMAuD3B,CAAC;AAEH;;GAEG;AACH,eAAO,MAAM,YAAY;UAOP,QAAQ,EAAE;YACN,QAAQ,EAAE;kJAE9B,CAAC;AAEH;;GAEG;AACH,eAAO,MAAM,YAAY,+LAkCvB,CAAC;AAEH;;GAEG;AACH,eAAO,MAAM,kBAAkB,2MAwC7B,CAAC;AAEH;;GAEG;AACH,eAAO,MAAM,kBAAkB,kMAgC7B,CAAC;AAEH;;GAEG;AACH,eAAO,MAAM,cAAc;;;;;;;oJAazB,CAAC;AAEH;;GAEG;AACH,eAAO,MAAM,gBAAgB;aAClB,MAAM;iBACF,MAAM;UACb,MAAM;8LAwDZ,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/azdo-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 AzdoSecurityError_base: Schema.Class<AzdoSecurityError, Schema.TaggedStruct<"AzdoSecurityError", {
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 AzdoSecurityError extends AzdoSecurityError_base {
10
+ }
11
+ declare const AzdoCommandError_base: Schema.Class<AzdoCommandError, Schema.TaggedStruct<"AzdoCommandError", {
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 AzdoCommandError extends AzdoCommandError_base {
21
+ }
22
+ declare const AzdoTimeoutError_base: Schema.Class<AzdoTimeoutError, Schema.TaggedStruct<"AzdoTimeoutError", {
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 AzdoTimeoutError extends AzdoTimeoutError_base {
31
+ }
32
+ declare const AzdoParseError_base: Schema.Class<AzdoParseError, Schema.TaggedStruct<"AzdoParseError", {
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 AzdoParseError extends AzdoParseError_base {
40
+ }
41
+ export type AzdoError = AzdoSecurityError | AzdoCommandError | AzdoTimeoutError | AzdoParseError;
42
+ export {};
43
+ //# sourceMappingURL=errors.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"errors.d.ts","sourceRoot":"","sources":["../../src/azdo-tool/errors.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;;;;;;;;AAEhC,qBAAa,iBAAkB,SAAQ,sBAStC;CAAG;;;;;;;;;;AAEJ,qBAAa,gBAAiB,SAAQ,qBAQpC;CAAG;;;;;;;;;AAEL,qBAAa,gBAAiB,SAAQ,qBAOpC;CAAG;;;;;;;;AAEL,qBAAa,cAAe,SAAQ,mBAMlC;CAAG;AAEL,MAAM,MAAM,SAAS,GAAG,iBAAiB,GAAG,gBAAgB,GAAG,gBAAgB,GAAG,cAAc,CAAC"}
@@ -0,0 +1 @@
1
+ {"version":3,"file":"extract-option-value.d.ts","sourceRoot":"","sources":["../../src/azdo-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/azdo-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/azdo-tool/security.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,mBAAmB,EAAE,MAAM,SAAS,CAAC;AAcjE,wBAAgB,gBAAgB,CAAC,GAAG,EAAE,MAAM,GAAG,mBAAmB,CA0GjE;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 { AzdoSecurityError, AzdoCommandError, AzdoTimeoutError, AzdoParseError } from "./errors";
5
+ import { ConfigService } from "#config";
6
+ declare const AzdoService_base: Context.ServiceClass<AzdoService, "@agent-tools/AzdoService", {
7
+ readonly runCommand: (cmd: string, project?: string) => Effect.Effect<string, AzdoSecurityError | AzdoCommandError | AzdoTimeoutError | AzdoParseError>;
8
+ readonly runInvoke: (params: InvokeParams) => Effect.Effect<unknown, AzdoSecurityError | AzdoCommandError | AzdoTimeoutError | AzdoParseError>;
9
+ }>;
10
+ export declare class AzdoService extends AzdoService_base {
11
+ static readonly layer: Layer.Layer<AzdoService, never, ConfigService | ChildProcessSpawner.ChildProcessSpawner>;
12
+ }
13
+ export declare const AzdoServiceLayer: Layer.Layer<AzdoService, 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/azdo-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,iBAAiB,EAAE,gBAAgB,EAAE,gBAAgB,EAAE,cAAc,EAAE,MAAM,UAAU,CAAC;AAGjG,OAAO,EAAE,aAAa,EAAiB,MAAM,SAAS,CAAC;;yBAM9B,CACnB,GAAG,EAAE,MAAM,EACX,OAAO,CAAC,EAAE,MAAM,KACb,MAAM,CAAC,MAAM,CAChB,MAAM,EACN,iBAAiB,GAAG,gBAAgB,GAAG,gBAAgB,GAAG,cAAc,CACzE;wBACmB,CAClB,MAAM,EAAE,YAAY,KACjB,MAAM,CAAC,MAAM,CAChB,OAAO,EACP,iBAAiB,GAAG,gBAAgB,GAAG,gBAAgB,GAAG,cAAc,CACzE;;AAfL,qBAAa,WAAY,SAAQ,gBAiBF;IAC7B,MAAM,CAAC,QAAQ,CAAC,KAAK,2FAmNnB;CACH;AAED,eAAO,MAAM,gBAAgB,0FAAoB,CAAC"}
@@ -0,0 +1 @@
1
+ {"version":3,"file":"transformers.d.ts","sourceRoot":"","sources":["../../src/azdo-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"}