infraweaver 0.3.7 → 0.3.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +2 -2
- package/dist/agents/claude.d.ts +1 -1
- package/dist/agents/claudePretoolGate.d.ts +0 -36
- package/dist/agents/toolPlaneWatch.d.ts +31 -0
- package/dist/cli.mjs +31908 -18736
- package/dist/external.d.ts +2 -1
- package/dist/index.js +31992 -18749
- package/dist/internal.js +133 -52
- package/dist/mcp/baseBranch.d.ts +41 -0
- package/dist/mcp/changeSummary.d.ts +1 -1
- package/dist/mcp/findingAudit.d.ts +2 -0
- package/dist/mcp/guardrails.d.ts +38 -0
- package/dist/mcp/localContext.d.ts +1 -1
- package/dist/mcp/moduleExtraction.d.ts +5 -0
- package/dist/mcp/pr.d.ts +0 -31
- package/dist/mcp/reproveSuggestions.d.ts +27 -0
- package/dist/mcp/review.d.ts +126 -2
- package/dist/mcp/reviewCommentLimit.d.ts +17 -0
- package/dist/mcp/reviewComments.d.ts +9 -5
- package/dist/mcp/reviewDedup.d.ts +1 -0
- package/dist/mcp/reviewMarkers.d.ts +10 -0
- package/dist/mcp/reviewProvenance.d.ts +20 -6
- package/dist/mcp/shared.d.ts +15 -0
- package/dist/mcp/suggestionProver.d.ts +3 -2
- package/dist/mcp/terraform/checkovSeverities.d.ts +7 -0
- package/dist/mcp/terraform/consolidation.d.ts +26 -0
- package/dist/mcp/terraform/cost.d.ts +2 -2
- package/dist/mcp/terraform/currency.d.ts +11 -0
- package/dist/mcp/terraform/deltaSummary.d.ts +11 -1
- package/dist/mcp/terraform/emittedArtefacts.d.ts +11 -0
- package/dist/mcp/terraform/evidence.d.ts +10 -0
- package/dist/mcp/terraform/gateScan.d.ts +2 -16
- package/dist/mcp/terraform/hcl.d.ts +15 -0
- package/dist/mcp/terraform/initArtefacts.d.ts +21 -0
- package/dist/mcp/terraform/localModules.d.ts +29 -0
- package/dist/mcp/terraform/moduleFindings.d.ts +38 -0
- package/dist/mcp/terraform/refactor/attribution.d.ts +1 -1
- package/dist/mcp/terraform/refactor/equivalence.d.ts +7 -0
- package/dist/mcp/terraform/refactor/expressions.d.ts +62 -0
- package/dist/mcp/terraform/refactor/references.d.ts +15 -0
- package/dist/mcp/terraform/refactor/resources.d.ts +11 -0
- package/dist/mcp/terraform/refactor/substitution.d.ts +55 -37
- package/dist/mcp/terraform/scanDelta.d.ts +28 -0
- package/dist/mcp/terraform/scanSession.d.ts +13 -0
- package/dist/mcp/terraform/scanners.d.ts +67 -18
- package/dist/mcp/terraform/secretScan.d.ts +19 -0
- package/dist/mcp/terraform/standardsReport.d.ts +1 -1
- package/dist/mcp/terraform/tools/plan.d.ts +1 -1
- package/dist/mcp/terraform/tools/scan.d.ts +7 -7
- package/dist/mcp/terraform/tools/validate.d.ts +7 -2
- package/dist/mcp/terraform/tools/verifyRemediation.d.ts +1 -1
- package/dist/mcp/terraform/treeLayout.d.ts +57 -0
- package/dist/mcp/terraform/types.d.ts +1 -1
- package/dist/phases/applyPlan.d.ts +0 -2
- package/dist/toolState.d.ts +3 -0
- package/dist/utils/agent/codexOAuth.d.ts +1 -1
- package/dist/utils/cli.d.ts +1 -7
- package/dist/utils/cloud/cloudReport.d.ts +1 -1
- package/dist/utils/config/baseRefConfig.d.ts +1 -1
- package/dist/utils/config/infraweaverConfig.d.ts +1 -1
- package/dist/utils/config/payload.d.ts +5 -0
- package/dist/utils/markdownTable.d.ts +6 -0
- package/dist/utils/setup/toolLicensing.d.ts +1 -1
- package/dist/utils/unifiedDiff.d.ts +69 -0
- package/package.json +34 -28
- package/src/agents/claude.ts +48 -13
- package/src/agents/claudePretoolGate.ts +9 -17
- package/src/agents/sessionLabeler.ts +3 -3
- package/src/agents/toolPlaneWatch.ts +71 -0
- package/src/external.ts +3 -1
- package/src/mcp/assess.ts +8 -8
- package/src/mcp/baseBranch.ts +96 -0
- package/src/mcp/changeSummary.ts +10 -11
- package/src/mcp/checkSuite.ts +7 -10
- package/src/mcp/checkout.ts +13 -40
- package/src/mcp/crosswalk.ts +5 -0
- package/src/mcp/findingAudit.ts +1 -1
- package/src/mcp/git.ts +44 -2
- package/src/mcp/guardrails.ts +188 -36
- package/src/mcp/localContext.ts +2 -0
- package/src/mcp/localServer.ts +1 -0
- package/src/mcp/moduleExtraction.ts +17 -5
- package/src/mcp/moduleTests.ts +9 -2
- package/src/mcp/modules.ts +10 -7
- package/src/mcp/pr.ts +17 -65
- package/src/mcp/reproveSuggestions.ts +86 -0
- package/src/mcp/review.ts +249 -75
- package/src/mcp/reviewAnchor.ts +11 -23
- package/src/mcp/reviewCommentLimit.ts +79 -0
- package/src/mcp/reviewComments.ts +34 -81
- package/src/mcp/reviewDedup.ts +1 -1
- package/src/mcp/reviewMarkers.ts +25 -2
- package/src/mcp/reviewProvenance.ts +56 -21
- package/src/mcp/roots.ts +3 -2
- package/src/mcp/server.ts +2 -1
- package/src/mcp/shared.ts +40 -1
- package/src/mcp/shell.ts +27 -28
- package/src/mcp/suggestionProver.ts +8 -4
- package/src/mcp/terraform/checkovSeverities.ts +1156 -0
- package/src/mcp/terraform/concernResult.ts +2 -1
- package/src/mcp/terraform/consolidation.ts +232 -19
- package/src/mcp/terraform/cost.ts +16 -7
- package/src/mcp/terraform/cspm.ts +8 -4
- package/src/mcp/terraform/currency.ts +28 -12
- package/src/mcp/terraform/decisions.ts +1 -1
- package/src/mcp/terraform/deltaSummary.ts +50 -1
- package/src/mcp/terraform/emittedArtefacts.ts +63 -0
- package/src/mcp/terraform/evidence.ts +23 -3
- package/src/mcp/terraform/gateScan.ts +191 -128
- package/src/mcp/terraform/hcl.ts +27 -2
- package/src/mcp/terraform/idleFloor.ts +2 -1
- package/src/mcp/terraform/initArtefacts.ts +76 -0
- package/src/mcp/terraform/localModules.ts +112 -0
- package/src/mcp/terraform/moduleDocs.ts +2 -5
- package/src/mcp/terraform/moduleFindings.ts +102 -0
- package/src/mcp/terraform/moduleVersionConstraints.ts +1 -1
- package/src/mcp/terraform/planPairs.ts +2 -20
- package/src/mcp/terraform/policyGate.ts +0 -15
- package/src/mcp/terraform/refactor/attribution.ts +39 -5
- package/src/mcp/terraform/refactor/equivalence.ts +49 -10
- package/src/mcp/terraform/refactor/expressions.ts +323 -0
- package/src/mcp/terraform/refactor/references.ts +101 -0
- package/src/mcp/terraform/refactor/resources.ts +79 -7
- package/src/mcp/terraform/refactor/substitution.ts +852 -256
- package/src/mcp/terraform/scanDelta.ts +41 -0
- package/src/mcp/terraform/scanSession.ts +30 -0
- package/src/mcp/terraform/scannerCache.ts +4 -0
- package/src/mcp/terraform/scanners.ts +553 -233
- package/src/mcp/terraform/secretScan.ts +131 -0
- package/src/mcp/terraform/standardsReport.ts +14 -13
- package/src/mcp/terraform/tools/consolidationCandidates.ts +3 -0
- package/src/mcp/terraform/tools/emitEvidence.ts +13 -5
- package/src/mcp/terraform/tools/emitOscal.ts +3 -2
- package/src/mcp/terraform/tools/emitVex.ts +10 -4
- package/src/mcp/terraform/tools/equivalenceCheck.ts +139 -21
- package/src/mcp/terraform/tools/infracostDiff.ts +2 -2
- package/src/mcp/terraform/tools/plan.ts +30 -17
- package/src/mcp/terraform/tools/reviewScanDelta.ts +3 -0
- package/src/mcp/terraform/tools/scan.ts +5 -3
- package/src/mcp/terraform/tools/standardsReport.ts +1 -1
- package/src/mcp/terraform/tools/validate.ts +20 -5
- package/src/mcp/terraform/tools/verifyRemediation.ts +14 -7
- package/src/mcp/terraform/tools/versionCurrency.ts +3 -1
- package/src/mcp/terraform/treeLayout.ts +378 -0
- package/src/mcp/terraform/types.ts +4 -1
- package/src/mcp/terraform/versionRequirements.ts +11 -2
- package/src/modes/__snapshots__/assemblePrompt.test.ts.snap +2 -0
- package/src/modes/modernize-deprecated.ts +2 -2
- package/src/modes/refactor.ts +9 -9
- package/src/modes/remediate.ts +1 -1
- package/src/modes/terraform-code-review.ts +7 -3
- package/src/modes/update-dependencies.ts +6 -6
- package/src/phases/applyPlan.ts +33 -14
- package/src/phases/applySuggestions.ts +2 -2
- package/src/phases/runAgentWithWatchdogs.ts +2 -1
- package/src/toolState.ts +7 -0
- package/src/utils/agent/codexOAuth.ts +7 -7
- package/src/utils/agent/openCodeModels.ts +4 -6
- package/src/utils/cli.ts +1 -31
- package/src/utils/cloud/runContext.ts +1 -8
- package/src/utils/config/baseRefConfig.ts +6 -0
- package/src/utils/config/infraweaverConfig.ts +2 -0
- package/src/utils/config/payload.ts +41 -0
- package/src/utils/github/assets.ts +1 -6
- package/src/utils/github/github.ts +42 -150
- package/src/utils/github/token.ts +6 -11
- package/src/utils/log.ts +4 -5
- package/src/utils/markdownTable.ts +11 -0
- package/src/utils/prompt/changeImpact.ts +18 -26
- package/src/utils/prompt/instructions.ts +1 -1
- package/src/utils/prompt/promptDirectives.ts +1 -1
- package/src/utils/prompt/toolSelection.ts +11 -2
- package/src/utils/setup/toolLicensing.ts +7 -0
- package/src/utils/telemetry.ts +2 -1
- package/src/utils/unifiedDiff.ts +120 -0
package/README.md
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
[](LICENSE)
|
|
4
4
|
[](https://github.com/infraweaver-io/infraweaver-action/actions/workflows/test.yml)
|
|
5
|
-
[](package.json) <!-- x-release-please-version -->
|
|
6
6
|
|
|
7
7
|
**Infraweaver brings your Terraform up to best practice — automatically, as reviewable pull requests.**
|
|
8
8
|
|
|
@@ -53,7 +53,7 @@ jobs:
|
|
|
53
53
|
- uses: aquasecurity/setup-trivy@81e514348e19b6112ce2a7e3ecbafe19c1e1f567 # v0.3.1
|
|
54
54
|
with:
|
|
55
55
|
# renovate: datasource=github-releases depName=aquasecurity/trivy
|
|
56
|
-
version: v0.
|
|
56
|
+
version: v0.74.0 # pin the TOOL too: a SHA-pinned action still installs floating-latest
|
|
57
57
|
- run: pipx install checkov
|
|
58
58
|
|
|
59
59
|
- name: Run Infraweaver
|
package/dist/agents/claude.d.ts
CHANGED
|
@@ -26,7 +26,7 @@ export declare function writeMcpConfig(ctx: AgentRunContext): string;
|
|
|
26
26
|
* 'sonnet' | 'opus' | 'haiku') and takes precedence over what's set here —
|
|
27
27
|
* we don't pass it; the per-subagent `model` field is the right default.
|
|
28
28
|
*
|
|
29
|
-
* The `model` is route-aware: the bare Anthropic-API id `claude-sonnet-5`
|
|
29
|
+
* The `model` is route-aware: the bare Anthropic-API id `claude-sonnet-5-5`
|
|
30
30
|
* is only valid on the direct API. On Bedrock (`eu.anthropic.…`) and Vertex
|
|
31
31
|
* (`@`-versioned) routes that id is rejected, and claude-code does not
|
|
32
32
|
* translate per-agent model names — so on those routes we omit `model`
|
|
@@ -34,42 +34,6 @@
|
|
|
34
34
|
* inside `ctx.tmpdir` (where `--settings` can find it) and survives bundle
|
|
35
35
|
* minification.
|
|
36
36
|
*/
|
|
37
|
-
/**
|
|
38
|
-
* The pinned `@anthropic-ai/claude-code` version against which the subagent
|
|
39
|
-
* gate's `agent_id` discriminator was last verified (see the contract notes in
|
|
40
|
-
* the gate source below). The gate fails OPEN for subagents if claude-code ever
|
|
41
|
-
* stops populating `agent_id` in the PreToolUse hook payload, so a version bump
|
|
42
|
-
* must be paired with a re-verification of `createBaseHookInput`.
|
|
43
|
-
*
|
|
44
|
-
* `claudePretoolGate.test.ts` asserts this equals the version pinned in
|
|
45
|
-
* `package.json` — that test fails on any bump, forcing the re-verification
|
|
46
|
-
* before the pin and this constant are updated together.
|
|
47
|
-
*
|
|
48
|
-
* 2.1.266 verified 2026-09-26 against the schema embedded in the installed
|
|
49
|
-
* binary: the base hook input still declares `agent_id` as
|
|
50
|
-
* `string().optional().describe("Subagent identifier. Present only when the
|
|
51
|
-
* hook fires from within a subagent (e.g., a tool called by an AgentTool
|
|
52
|
-
* worker). Absent for the main thread, even in --agent sessions. Use this
|
|
53
|
-
* field (not agent_type) to distinguish subagent calls from main-thread
|
|
54
|
-
* calls.")` — exactly the discriminator the gate relies on, byte-for-byte
|
|
55
|
-
* unchanged from the 2.1.220 verification (2026-07-28), which was itself
|
|
56
|
-
* unchanged from 2.1.198 (2026-07-10), 2.1.195 (2026-07-01) and 2.1.190
|
|
57
|
-
* (2026-06-25), the last of which was more explicit than the 2.1.177 schema it
|
|
58
|
-
* replaced. The 2.1.266 pass also re-confirmed the field is POPULATED and not
|
|
59
|
-
* merely declared: `createBaseHookInput` (minified; the names change per build)
|
|
60
|
-
* returns `{ …, agent_id: o?.agentId, agent_type: d, … }` — read off the caller's
|
|
61
|
-
* context object, not a hardcoded empty string. (The bundle does contain an
|
|
62
|
-
* `agent_id:""` literal, but on a different path — the coercion
|
|
63
|
-
* `Xu(e.agent_id) ? String(e.agent_id) : ""` that normalises an ABSENT id on
|
|
64
|
-
* the main thread, which is the documented behaviour, not the hook builder.)
|
|
65
|
-
*
|
|
66
|
-
* Scope of this verification, stated honestly: it is static inspection of the
|
|
67
|
-
* shipped binary. No CI job exercises the Claude subagent gate against a live
|
|
68
|
-
* agent — `security-tests.yml` is deliberately opencode-only (free keyless
|
|
69
|
-
* model; Claude Code cannot use an `opencode/*` gateway model). So this pin,
|
|
70
|
-
* plus the tripwire test, IS the contract check. Keep both.
|
|
71
|
-
*/
|
|
72
|
-
export declare const CLAUDE_CODE_AGENT_ID_VERIFIED_VERSION: "2.1.266";
|
|
73
37
|
/**
|
|
74
38
|
* Source written to `<ctx.tmpdir>/infraweaver-pretool-gate.mjs`. Plain ESM,
|
|
75
39
|
* no TypeScript, no dependencies — node executes it directly via the
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Notices when the agent has lost the infraweaver tool server, so the run stops
|
|
3
|
+
* instead of spending its budget without it.
|
|
4
|
+
*
|
|
5
|
+
* Every deliverable — the push, the pull request, the review, the final
|
|
6
|
+
* progress report — goes through that server. Once Claude Code drops it, each
|
|
7
|
+
* call fails at once with "not connected", and a model told to keep trying
|
|
8
|
+
* retries in a tight loop until the token quota ends the run: a refactor did
|
|
9
|
+
* exactly that for 41 minutes and 8.5M tokens.
|
|
10
|
+
*
|
|
11
|
+
* One lost call is not enough to stop on: Claude Code reconnects, and a call
|
|
12
|
+
* that lands mid-reconnect fails the same way. The run stops only after
|
|
13
|
+
* {@link LOST_CALLS} such failures in a row spanning at least
|
|
14
|
+
* {@link LOST_WINDOW_MS}, with no infraweaver call succeeding in between.
|
|
15
|
+
*/
|
|
16
|
+
export declare const LOST_CALLS = 3;
|
|
17
|
+
export declare const LOST_WINDOW_MS = 30000;
|
|
18
|
+
export declare class ToolPlaneLostError extends Error {
|
|
19
|
+
constructor(calls: number, seconds: number);
|
|
20
|
+
}
|
|
21
|
+
export interface ToolResult {
|
|
22
|
+
/** the tool that was called, when known. */
|
|
23
|
+
toolName: string | undefined;
|
|
24
|
+
isError: boolean;
|
|
25
|
+
text: string;
|
|
26
|
+
}
|
|
27
|
+
export declare function createToolPlaneWatch(now?: () => number): {
|
|
28
|
+
/** Record one tool result; returns the error to stop with once the server is lost. */
|
|
29
|
+
observe(result: ToolResult): ToolPlaneLostError | null;
|
|
30
|
+
};
|
|
31
|
+
export type ToolPlaneWatch = ReturnType<typeof createToolPlaneWatch>;
|