@fjall/generator 11.0.0 → 12.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.
- package/dist/.build-source-hash +21 -20
- package/dist/.minified +1 -1
- package/dist/src/ast/astTestHelpers.d.ts +3 -3
- package/dist/src/codemod/index.d.ts +1 -1
- package/dist/src/codemod/index.js +1 -1
- package/dist/src/codemod/llmFallback/claudeTier.js +1 -1
- package/dist/src/codemod/llmFallback/egressGate.d.ts +2 -2
- package/dist/src/codemod/llmFallback/egressGate.js +1 -1
- package/dist/src/codemod/llmFallback/egressGate.types.d.ts +3 -2
- package/dist/src/codemod/llmFallback/gateFallbackOutput.d.ts +32 -0
- package/dist/src/codemod/llmFallback/gateFallbackOutput.js +1 -0
- package/dist/src/codemod/llmFallback/index.d.ts +3 -2
- package/dist/src/codemod/llmFallback/index.js +1 -1
- package/dist/src/codemod/llmFallback/morphTier.js +2 -2
- package/dist/src/codemod/llmFallback/runFallback.d.ts +12 -1
- package/dist/src/codemod/llmFallback/runFallback.js +1 -1
- package/dist/src/codemod/llmFallback/telemetryEvents.d.ts +10 -1
- package/dist/src/codemod/llmFallback/telemetryEvents.js +1 -1
- package/dist/src/codemod/llmFallback/types.d.ts +9 -1
- package/dist/src/codemod/types.d.ts +9 -1
- package/dist/src/codemod/validationGate/index.d.ts +1 -1
- package/dist/src/codemod/validationGate/index.js +1 -1
- package/dist/src/dns/domainFileGenerator.js +1 -1
- package/dist/src/presets/tierTypes.d.ts +1 -1
- package/dist/src/schemas/alarmSchemas.d.ts +3 -3
- package/dist/src/schemas/alarmSchemas.js +1 -1
- package/dist/src/schemas/applicationSchemas.d.ts +3 -3
- package/dist/src/schemas/computeSchemas.d.ts +9 -9
- package/dist/src/version.d.ts +1 -1
- package/dist/src/version.js +1 -1
- package/package.json +2 -2
package/dist/.build-source-hash
CHANGED
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
"package.json",
|
|
10
10
|
"tsconfig.json"
|
|
11
11
|
],
|
|
12
|
-
"hash": "
|
|
12
|
+
"hash": "fa029ff864130e5861fec3e0393668295eb9dd41ba4903c287d1c4969edf2289",
|
|
13
13
|
"files": {
|
|
14
14
|
"src/ast/astTestHelpers.ts": "026cac849eb88bdb",
|
|
15
15
|
"src/ast/domain/astDomainParser.ts": "940ce5742507477d",
|
|
@@ -74,21 +74,22 @@
|
|
|
74
74
|
"src/codemod/fileRewriter/parse.ts": "b12026c31562a13c",
|
|
75
75
|
"src/codemod/fileRewriter/print.ts": "f5ff7afb5b7786bf",
|
|
76
76
|
"src/codemod/historyPaths.ts": "ef8084013146db57",
|
|
77
|
-
"src/codemod/index.ts": "
|
|
77
|
+
"src/codemod/index.ts": "b90c77ffc82e09df",
|
|
78
78
|
"src/codemod/listResources.ts": "97f206a50edbea20",
|
|
79
79
|
"src/codemod/llmFallback/apply.ts": "2e656a6e55b3b4e3",
|
|
80
|
-
"src/codemod/llmFallback/claudeTier.ts": "
|
|
81
|
-
"src/codemod/llmFallback/egressGate.ts": "
|
|
82
|
-
"src/codemod/llmFallback/egressGate.types.ts": "
|
|
83
|
-
"src/codemod/llmFallback/
|
|
84
|
-
"src/codemod/llmFallback/
|
|
80
|
+
"src/codemod/llmFallback/claudeTier.ts": "ace3e3baa51383c9",
|
|
81
|
+
"src/codemod/llmFallback/egressGate.ts": "1b9076a5c51508fc",
|
|
82
|
+
"src/codemod/llmFallback/egressGate.types.ts": "e30947f12ee546ff",
|
|
83
|
+
"src/codemod/llmFallback/gateFallbackOutput.ts": "d61dc46527c566b8",
|
|
84
|
+
"src/codemod/llmFallback/index.ts": "d32779fa95df6b94",
|
|
85
|
+
"src/codemod/llmFallback/morphTier.ts": "adcc1cf280f9a65d",
|
|
85
86
|
"src/codemod/llmFallback/prompt.ts": "60e8f4ab434bf9ec",
|
|
86
|
-
"src/codemod/llmFallback/runFallback.ts": "
|
|
87
|
+
"src/codemod/llmFallback/runFallback.ts": "03880734d6c456af",
|
|
87
88
|
"src/codemod/llmFallback/shouldTryFallback.ts": "df6038f97612b8ee",
|
|
88
89
|
"src/codemod/llmFallback/signals.ts": "298bae6465b5f173",
|
|
89
|
-
"src/codemod/llmFallback/telemetryEvents.ts": "
|
|
90
|
+
"src/codemod/llmFallback/telemetryEvents.ts": "827282cb185eea6c",
|
|
90
91
|
"src/codemod/llmFallback/tierRunner.ts": "a26094accd78cf15",
|
|
91
|
-
"src/codemod/llmFallback/types.ts": "
|
|
92
|
+
"src/codemod/llmFallback/types.ts": "0b528ccbab7d48b8",
|
|
92
93
|
"src/codemod/registry.ts": "fca9df965dd2d7ed",
|
|
93
94
|
"src/codemod/semanticIndex/classifyControlFlow.ts": "ed96215d91a3cae3",
|
|
94
95
|
"src/codemod/semanticIndex/findReferences.ts": "96aea37418d1e91a",
|
|
@@ -98,18 +99,18 @@
|
|
|
98
99
|
"src/codemod/semanticIndex/projectCache.ts": "dfd9b265c9d233c9",
|
|
99
100
|
"src/codemod/semanticIndex/resolveConstructByLiteralProperty.ts": "2d013a330af15c5c",
|
|
100
101
|
"src/codemod/telemetry/errorKinds.ts": "66c736abfa8b3a67",
|
|
101
|
-
"src/codemod/types.ts": "
|
|
102
|
+
"src/codemod/types.ts": "41a3d0a462f5fc86",
|
|
102
103
|
"src/codemod/validationGate/gates/classify.ts": "3cba0ee8fe6d94d9",
|
|
103
104
|
"src/codemod/validationGate/gates/drift.ts": "bd603a216fbb91a9",
|
|
104
105
|
"src/codemod/validationGate/gates/locate.ts": "2c186c32edbb97ce",
|
|
105
106
|
"src/codemod/validationGate/gates/parse.ts": "5433c5c8ffa35324",
|
|
106
107
|
"src/codemod/validationGate/gates/schema.ts": "7ed5acaec0620a46",
|
|
107
|
-
"src/codemod/validationGate/index.ts": "
|
|
108
|
+
"src/codemod/validationGate/index.ts": "47b475a621f5038a",
|
|
108
109
|
"src/codemod/validationGate/types.ts": "af466ee5f3433042",
|
|
109
110
|
"src/detection/index.ts": "b4ad9a935564cb3e",
|
|
110
111
|
"src/dns/bindParser.ts": "376d274bf9e4bf9f",
|
|
111
112
|
"src/dns/bindWriter.ts": "c296911ce5aef77c",
|
|
112
|
-
"src/dns/domainFileGenerator.ts": "
|
|
113
|
+
"src/dns/domainFileGenerator.ts": "29ece83900ecc829",
|
|
113
114
|
"src/dns/domainRecords.ts": "ab917006b92ae916",
|
|
114
115
|
"src/dns/index.ts": "b476ef3d7b381dc8",
|
|
115
116
|
"src/dns/types.ts": "82d6db9d7d26dbc2",
|
|
@@ -140,18 +141,18 @@
|
|
|
140
141
|
"src/presets/patternTierPresets.ts": "f4fc368fc623aae4",
|
|
141
142
|
"src/presets/storagePresets.ts": "5df2d4d7d21a66d8",
|
|
142
143
|
"src/presets/tierPresets.ts": "c0148771bffbef9b",
|
|
143
|
-
"src/presets/tierTypes.ts": "
|
|
144
|
+
"src/presets/tierTypes.ts": "6526373876daacf0",
|
|
144
145
|
"src/projection/index.ts": "f46e0e482bb33565",
|
|
145
146
|
"src/projection/project.ts": "2104026f10a27264",
|
|
146
147
|
"src/projection/tables.ts": "00904da382c06cf5",
|
|
147
148
|
"src/projection/types.ts": "da0845cb34bfd12b",
|
|
148
|
-
"src/schemas/alarmSchemas.ts": "
|
|
149
|
+
"src/schemas/alarmSchemas.ts": "a6f6ac07b2a102de",
|
|
149
150
|
"src/schemas/applicationSchemas.ts": "d85771a4607cf2da",
|
|
150
151
|
"src/schemas/baseSchemas.ts": "93d9bd1c0adfcaa0",
|
|
151
152
|
"src/schemas/buildkiteSchemas.ts": "a28ec3b40f7851ec",
|
|
152
153
|
"src/schemas/cdnSchemas.ts": "a982034c7903a31a",
|
|
153
154
|
"src/schemas/computeSchemas.ts": "907747add0b1e1a9",
|
|
154
|
-
"src/schemas/constants.ts": "
|
|
155
|
+
"src/schemas/constants.ts": "732a290de68e4ff8",
|
|
155
156
|
"src/schemas/databaseSchemas.ts": "3c05f176e1aadb46",
|
|
156
157
|
"src/schemas/devRolePolicies.ts": "6ca70fb20f5fbebc",
|
|
157
158
|
"src/schemas/index.ts": "a1500a885048074b",
|
|
@@ -169,11 +170,11 @@
|
|
|
169
170
|
"src/validation/patterns.ts": "f9629eafdad7ac3e",
|
|
170
171
|
"src/validation/validationMessages.ts": "c727ade4690274f4",
|
|
171
172
|
"src/validation/validationPatterns.ts": "865f3d688975b7c8",
|
|
172
|
-
"src/version.ts": "
|
|
173
|
+
"src/version.ts": "360d8be98d7f0b6a",
|
|
173
174
|
"../scripts/minify-dist.mjs": "6b2e4b0df8aec601",
|
|
174
|
-
"package.json": "
|
|
175
|
+
"package.json": "9e18c6eff5975fbc",
|
|
175
176
|
"tsconfig.json": "1929cf3f99fe9b1e"
|
|
176
177
|
},
|
|
177
|
-
"outputHash": "
|
|
178
|
-
"outputFileCount":
|
|
178
|
+
"outputHash": "a9bbc2ebb1234fd1a41c3f717b8df4d4c8cd124a457456bc05a573ff5eca0af2",
|
|
179
|
+
"outputFileCount": 321
|
|
179
180
|
}
|
package/dist/.minified
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
160 files minified at 2026-08-15T06:01:40.068Z
|
|
@@ -247,10 +247,10 @@ export declare function parseAndConvert(code: string): {
|
|
|
247
247
|
sourceText: string;
|
|
248
248
|
}[] | undefined;
|
|
249
249
|
alarms?: false | {
|
|
250
|
-
cpuThreshold?: number | undefined;
|
|
251
|
-
memoryThreshold?: number | undefined;
|
|
250
|
+
cpuThreshold?: number | false | undefined;
|
|
251
|
+
memoryThreshold?: number | false | undefined;
|
|
252
252
|
runningTasksMinimum?: number | undefined;
|
|
253
|
-
http5xxThreshold?: number | undefined;
|
|
253
|
+
http5xxThreshold?: number | false | undefined;
|
|
254
254
|
} | undefined;
|
|
255
255
|
}[] | undefined;
|
|
256
256
|
docker?: {
|
|
@@ -21,5 +21,5 @@ export { evaluateEmitGuard, UNRESOLVED, type EmitGuardProperties, type EmitGuard
|
|
|
21
21
|
export { CODEMOD_ERROR_KINDS } from "./telemetry/errorKinds.js";
|
|
22
22
|
export type { CodemodErrorKind } from "./telemetry/errorKinds.js";
|
|
23
23
|
export type { GateId } from "./validationGate/index.js";
|
|
24
|
-
export { buildEgressBlockedEvent, buildFiredEvent, buildGateFailedEvent, buildGatePassedEvent, buildRejectedEvent, buildSucceededEvent, buildTimeoutEvent, estimateCostUsd, FALLBACK_EVENTS, GATE_EVENTS, PARSE_GATE, RUNTIME_GATE, runFallback, shouldTryFallback, type AnthropicClientProvider, type FallbackClients, type FallbackDecision, type FallbackEgressBlockedEvent, type FallbackGuardConfig, type FallbackInput, type FallbackIntent, type FallbackOp, type FallbackOutput, type FallbackTelemetry, type FallbackTelemetryEvent, type MorphClientProvider, type RunFallbackInput, type TelemetrySource, type TriggerReason, } from "./llmFallback/index.js";
|
|
24
|
+
export { buildEgressBlockedEvent, buildFiredEvent, buildGateFailedEvent, buildGatePassedEvent, buildRejectedEvent, buildSucceededEvent, buildTimeoutEvent, estimateCostUsd, FALLBACK_EVENTS, GATE_EVENTS, gateFallbackOutput, PARSE_GATE, RUNTIME_GATE, runFallback, shouldTryFallback, UNATTRIBUTED_ORGANISATION, type AnthropicClientProvider, type AnthropicContentBlock, type AnthropicResponse, type EgressStage, type FallbackClients, type FallbackDecision, type FallbackEgressBlockedEvent, type FallbackGuardConfig, type FallbackInput, type FallbackIntent, type FallbackOp, type FallbackOutput, type FallbackTelemetry, type FallbackTelemetryEvent, type GateEventAction, type GateFallbackParams, type MorphClientProvider, type RunFallbackInput, type TelemetrySource, type TriggerReason, } from "./llmFallback/index.js";
|
|
25
25
|
export type { AddOptions, CodemodError, CodemodSuccess, ControlFlowClassifierError, DriftConflictError, DriftUnmergeableError, DuplicateResourceError, EditOrchestratorSuccess, InvalidPropertyError, LinesChanged, LlmFallbackRejectedError, LlmFallbackTimeoutError, LlmFallbackTier, LlmFallbackUnsafeInputError, MissingAppInitError, ModifyOptions, NodeLocation, ParseError, PermissionError, ReferenceLocation, ReferencesRemainError, RemoveOptions, ResourceListing, ResourceListingEntry, ResourceName, ResourceNotFoundError, SemanticQueryError, StatementType, TemplateLiteralNameError, } from "./types.js";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{addResource as o}from"./edits/addResource.js";import{removeResource as c}from"./edits/removeResource.js";import{modifyResource as m}from"./edits/modifyResource.js";import{appendAccountToStage as
|
|
1
|
+
import{addResource as o}from"./edits/addResource.js";import{removeResource as c}from"./edits/removeResource.js";import{modifyResource as m}from"./edits/modifyResource.js";import{appendAccountToStage as s}from"./edits/appendAccountToStage.js";import{setContainerSecrets as E}from"./edits/setContainerSecrets.js";import{connectResourceToCompute as l}from"./edits/connectResourceToCompute.js";import{addVpcPeer as u,modifyVpcPeer as f,removeVpcPeer as T}from"./edits/vpcPeer.js";import{addVpcPeerAccepter as R,modifyVpcPeerAccepter as x,removeVpcPeerAccepter as S}from"./edits/vpcPeerAccepter.js";import{addCrossPlanConnection as v,modifyCrossPlanConnection as C,removeCrossPlanConnection as N}from"./edits/crossPlanConnection.js";import{resolveDriftPolicy as b}from"./edits/driftPolicy.js";import{listResources as y}from"./listResources.js";import{resolveConstructByLiteralProperty as G}from"./semanticIndex/index.js";import{parse as I}from"./fileRewriter/parse.js";import{CrossPlanConnectionResourcePlanSchema as F,VpcPeerAccepterResourcePlanSchema as L,VpcPeerResourcePlanSchema as U}from"../schemas/index.js";import{detectDrift as k,mergeProperties as B,snapshotProperties as M}from"./drift/index.js";import{computeLinesDelta as Y}from"./_internal.js";import{ResourceNameSchema as q,StatementTypeSchema as w}from"./types.js";import{REGISTERED_STATEMENT_TYPES as H,STATEMENT_REGISTRY as J}from"./registry.js";import{evaluateEmitGuard as W,UNRESOLVED as X}from"./emitGuard.js";import{CODEMOD_ERROR_KINDS as $}from"./telemetry/errorKinds.js";import{buildEgressBlockedEvent as re,buildFiredEvent as oe,buildGateFailedEvent as te,buildGatePassedEvent as ce,buildRejectedEvent as pe,buildSucceededEvent as me,buildTimeoutEvent as ae,estimateCostUsd as se,FALLBACK_EVENTS as ne,GATE_EVENTS as Ee,gateFallbackOutput as de,PARSE_GATE as le,RUNTIME_GATE as ie,runFallback as ue,shouldTryFallback as fe,UNATTRIBUTED_ORGANISATION as Te}from"./llmFallback/index.js";export{$ as CODEMOD_ERROR_KINDS,F as CrossPlanConnectionResourcePlanSchema,ne as FALLBACK_EVENTS,Ee as GATE_EVENTS,le as PARSE_GATE,H as REGISTERED_STATEMENT_TYPES,ie as RUNTIME_GATE,q as ResourceNameSchema,J as STATEMENT_REGISTRY,w as StatementTypeSchema,Te as UNATTRIBUTED_ORGANISATION,X as UNRESOLVED,L as VpcPeerAccepterResourcePlanSchema,U as VpcPeerResourcePlanSchema,v as addCrossPlanConnection,o as addResource,u as addVpcPeer,R as addVpcPeerAccepter,s as appendAccountToStage,re as buildEgressBlockedEvent,oe as buildFiredEvent,te as buildGateFailedEvent,ce as buildGatePassedEvent,pe as buildRejectedEvent,me as buildSucceededEvent,ae as buildTimeoutEvent,Y as computeLinesDelta,l as connectResourceToCompute,k as detectDrift,se as estimateCostUsd,W as evaluateEmitGuard,de as gateFallbackOutput,y as listResources,B as mergeProperties,C as modifyCrossPlanConnection,m as modifyResource,f as modifyVpcPeer,x as modifyVpcPeerAccepter,I as parse,N as removeCrossPlanConnection,c as removeResource,T as removeVpcPeer,S as removeVpcPeerAccepter,G as resolveConstructByLiteralProperty,b as resolveDriftPolicy,ue as runFallback,E as setContainerSecrets,fe as shouldTryFallback,M as snapshotProperties};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
var
|
|
1
|
+
var y=Object.defineProperty;var l=(t,r)=>y(t,"name",{value:r,configurable:!0});import{maskSensitiveOutput as S}from"@fjall/util";import{gateEgress as u}from"./egressGate.js";import{buildPrompt as E}from"./prompt.js";import{applyStrReplaceOps as O}from"./apply.js";import{withTierTimeout as b}from"./tierRunner.js";import{PARSE_GATE as d}from"./types.js";const M=3e4,e="claude",f={name:"str_replace_based_edit_tool",type:"text_editor_20250728"};async function C(t,r){if(!t.orgAllowsFallback)return{state:"disabled",reason:"org-opt-out"};const s=u(t.content,e,"input");if(s!==void 0)return s;const o=u(JSON.stringify(t.intent.properties),e,"input");if(o!==void 0)return o;const{systemPrompt:i,userPrompt:a}=E({content:t.content,intent:t.intent,tier:e});return b(t.abortSignal,e,M,async({signal:_,started:g})=>{const p=await r.create({model:r.resolveModelId(),max_tokens:4096,system:i,messages:[{role:"user",content:a}],tools:[f],signal:_}),T=Date.now()-g,c=w(p.content);if(c.length===0)return{state:"rejected",tier:e,failedGate:d,diagnostics:"Model produced no str_replace operations"};const n=O(t.content,c);if(!n.success){const k=S(n.error.old_str).slice(0,40);return{state:"rejected",tier:e,failedGate:d,diagnostics:`Ambiguous str_replace at op ${n.error.opIndex}: "${k}\u2026" matched ${n.error.matchCount} times`}}if(n.data.appliedCount===0)return{state:"rejected",tier:e,failedGate:d,diagnostics:`Model emitted ${String(c.length)} operation(s) but none matched the file`};if(n.data.content===t.content)return{state:"rejected",tier:e,failedGate:d,diagnostics:`Model emitted ${String(c.length)} operation(s) that left the file unchanged`};const m=u(n.data.content,e,"output");if(m!==void 0)return m;const h={tier:e,elapsedMs:T,inputTokens:p.usage?.input_tokens??0,outputTokens:p.usage?.output_tokens??0,opsApplied:n.data.appliedCount};return{state:"applied",content:n.data.content,telemetry:h}})}l(C,"runClaudeTier");function w(t){const r=[];for(const s of t){if(s.type!=="tool_use"||s.name!==f.name)continue;const o=s.input;if(!("command"in o)||o.command!=="str_replace"||!("old_str"in o)||!("new_str"in o))continue;const i=o.old_str,a=o.new_str;typeof i!="string"||typeof a!="string"||r.push({old_str:i,new_str:a})}return r}l(w,"extractStrReplaceOps");export{f as TEXT_EDITOR_TOOL,C as runClaudeTier};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { LlmFallbackTier } from "../types.js";
|
|
2
2
|
import type { EgressGateResult } from "./egressGate.types.js";
|
|
3
|
-
import type { FallbackOutput } from "./types.js";
|
|
3
|
+
import type { EgressStage, FallbackOutput } from "./types.js";
|
|
4
4
|
export declare function scanForEgressRisk(content: string): EgressGateResult;
|
|
5
|
-
export declare function gateEgress(content: string, tier: LlmFallbackTier): FallbackOutput | undefined;
|
|
5
|
+
export declare function gateEgress(content: string, tier: LlmFallbackTier, stage: EgressStage): FallbackOutput | undefined;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
var
|
|
1
|
+
var l=Object.defineProperty;var r=(t,e)=>l(t,"name",{value:e,configurable:!0});import{MASKED_VALUE_MARKER as c,maskSensitiveOutput as h}from"@fjall/util";const i=32,f=4.5,g=/\barn:aws[a-z-]*:[a-z0-9-]+:[a-z0-9-]*:[0-9]*:[^\s"']+/g,E=/(?<![A-Za-z0-9+/=_-])[A-Za-z0-9+/=_-]{32,}(?![A-Za-z0-9+/=_-])/g;function _(t){if(t.length===0)return 0;const e=new Map;for(const n of t)e.set(n,(e.get(n)??0)+1);let o=0;for(const n of e.values()){const s=n/t.length;o-=s*Math.log2(s)}return o}r(_,"shannonEntropy");function u(t,e){let o=0,n=0;for(;;){const s=t.indexOf(e,n);if(s===-1)break;o+=1,n=s+e.length}return o}r(u,"countOccurrences");function p(t){const e=[...t.matchAll(g)];if(e.length>0)return{state:"block",reason:"arn-shape",count:e.length};const o=h(t);if(o!==t){const s=u(o,c)-u(t,c);return{state:"block",reason:"credential-pattern",count:Math.max(1,s)}}const n=[];for(const s of t.matchAll(E)){const a=s[0]??"";a.length>=i&&_(a)>=f&&n.push(a)}return n.length>0?{state:"block",reason:"high-entropy",count:n.length}:{state:"pass"}}r(p,"scanForEgressRisk");function k(t,e,o){const n=p(t);if(n.state==="block")return{state:"egress-blocked",tier:e,reason:n.reason,count:n.count,stage:o}}r(k,"gateEgress");export{k as gateEgress,p as scanForEgressRisk};
|
|
@@ -1,9 +1,10 @@
|
|
|
1
|
-
|
|
1
|
+
/** Which egress scan fired: the pre-send input scan or the model-output scan. */
|
|
2
|
+
export type EgressStage = "input" | "output";
|
|
3
|
+
export type EgressRiskReason = "high-entropy" | "arn-shape" | "credential-pattern";
|
|
2
4
|
export type EgressGateResult = {
|
|
3
5
|
state: "pass";
|
|
4
6
|
} | {
|
|
5
7
|
state: "block";
|
|
6
8
|
reason: EgressRiskReason;
|
|
7
9
|
count: number;
|
|
8
|
-
sampleHint: string;
|
|
9
10
|
};
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import type { ResourceSnapshot } from "../drift/index.js";
|
|
2
|
+
import type { LlmFallbackTier } from "../types.js";
|
|
3
|
+
import { type GateId } from "../validationGate/index.js";
|
|
4
|
+
import type { FallbackIntent } from "./types.js";
|
|
5
|
+
import type { FallbackOutput } from "./types.js";
|
|
6
|
+
export type GateEventAction = "pass" | "fail";
|
|
7
|
+
export interface GateFallbackParams {
|
|
8
|
+
/** The tier's applied content — the candidate for the write. */
|
|
9
|
+
outputContent: string;
|
|
10
|
+
/** The pre-fallback source the model was shown (classify gate's before-side). */
|
|
11
|
+
inputContent: string;
|
|
12
|
+
intent: FallbackIntent;
|
|
13
|
+
tier: LlmFallbackTier;
|
|
14
|
+
/**
|
|
15
|
+
* Drift baseline, threaded from the caller when it has one. Optional for
|
|
16
|
+
* parity with the deterministic path: absent ⇒ the drift gate is a
|
|
17
|
+
* vacuous proceed, exactly as `addResource`/`modifyResource` behave when
|
|
18
|
+
* called without a baseline context.
|
|
19
|
+
*/
|
|
20
|
+
baseline?: ResourceSnapshot;
|
|
21
|
+
abortSignal?: AbortSignal;
|
|
22
|
+
onGateResult?: (gate: GateId, action: GateEventAction, durationMs: number) => void;
|
|
23
|
+
}
|
|
24
|
+
/**
|
|
25
|
+
* Run the validation-gate chain on applied fallback output.
|
|
26
|
+
*
|
|
27
|
+
* Returns `undefined` when every gate passes (the caller keeps the applied
|
|
28
|
+
* result), or a substitute `FallbackOutput` — "rejected" carrying the real
|
|
29
|
+
* failed gate id with diagnostics pre-masked at construction, or
|
|
30
|
+
* "cancelled" when the caller's abort signal fired between gates.
|
|
31
|
+
*/
|
|
32
|
+
export declare function gateFallbackOutput(params: GateFallbackParams): FallbackOutput | undefined;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var m=Object.defineProperty;var c=(e,t)=>m(e,"name",{value:t,configurable:!0});import{isDeepStrictEqual as $}from"node:util";import{maskSensitiveOutput as d}from"@fjall/util";import{STATEMENT_REGISTRY as h}from"../registry.js";import{classifyGate as l,createLocateGate as p,driftGate as G,parseGate as f,schemaGate as b}from"../validationGate/index.js";function D(e){const{intent:t,tier:i}=e;if(t.op==="add"&&h[t.type].addContract===void 0)return{state:"rejected",tier:i,failedGate:"schema",diagnostics:`LLM fallback cannot add a ${t.type}: its complete add contract is not yet declared. Nothing has been written.`};const g={type:t.type,name:t.name,properties:t.properties,op:t.op==="add"?"add":"modify"},y={content:e.outputContent,plan:g,inputContent:e.inputContent,...e.baseline!==void 0&&{baseline:e.baseline},...e.abortSignal!==void 0&&{signal:e.abortSignal}};for(const n of E(t.op)){if(e.abortSignal?.aborted===!0)return{state:"cancelled"};const u=Date.now();let a;try{a=n.run(y)}catch(o){return e.onGateResult?.(n.id,"fail",Date.now()-u),{state:"rejected",tier:i,failedGate:n.id,diagnostics:d(o instanceof Error?o.message:String(o))}}const s=Date.now()-u;if(!a.success)return e.onGateResult?.(n.id,"fail",s),{state:"rejected",tier:i,failedGate:n.id,diagnostics:d(S(a.error))};if(a.data.action==="reject")return e.onGateResult?.(n.id,"fail",s),{state:"rejected",tier:i,failedGate:a.data.failedGate??n.id,diagnostics:d(a.data.diagnostics??"gate rejected the output")};if(a.data.driftState!==void 0){const o=a.data.driftState.deltas.filter(r=>r.verdict==="clean"&&Object.hasOwn(t.properties,r.property)&&!$(r.theirs,r.ours)).map(r=>`\`${r.property}\``);if(o.length>0)return e.onGateResult?.(n.id,"fail",s),{state:"rejected",tier:i,failedGate:n.id,diagnostics:d(`output left requested ${o.length===1?"property":"properties"} at the baseline value: ${o.join(", ")}`)}}e.onGateResult?.(n.id,"pass",s)}}c(D,"gateFallbackOutput");function E(e){return e==="remove"?[f,l,p({mode:"absent"})]:[f,l,p({mode:"present"}),b,G]}c(E,"gatesForOp");function S(e){switch(e.kind){case"ParseError":return`output does not parse: ${e.message}`;case"ControlFlowClassifierError":return`output moved ${e.resource.type} "${e.resource.name}" out of top-level scope (${e.reason})`;case"ResourceNotFoundError":return`${e.type} "${e.name}" is missing from the output`;case"DuplicateResourceError":return`${e.type} "${e.name}" is still present in the output`;case"TemplateLiteralNameError":return`output names the resource with a template literal (line ${String(e.line)})`;case"InvalidPropertyError":return`property \`${e.property}\`: ${e.reason}`;case"DriftConflictError":{const t=e.deltas.filter(i=>i.verdict==="conflict").map(i=>`\`${i.property}\``).join(", ");return`output conflicts with the requested properties on ${e.resource.type} "${e.resource.name}"`+(t.length>0?` (${t})`:"")}case"SemanticQueryError":return`output could not be analysed: ${e.reason}`;default:return e.kind}}c(S,"describeGateError");export{D as gateFallbackOutput};
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
export { runFallback, type FallbackClients, type RunFallbackInput, } from "./runFallback.js";
|
|
2
|
+
export { gateFallbackOutput, type GateEventAction, type GateFallbackParams, } from "./gateFallbackOutput.js";
|
|
2
3
|
export { shouldTryFallback, type FallbackDecision, type FallbackGuardConfig, } from "./shouldTryFallback.js";
|
|
3
|
-
export { buildEgressBlockedEvent, buildFiredEvent, buildGateFailedEvent, buildGatePassedEvent, buildRejectedEvent, buildSucceededEvent, buildTimeoutEvent, estimateCostUsd, FALLBACK_EVENTS, GATE_EVENTS, type FallbackEgressBlockedEvent, type FallbackFiredEvent, type FallbackRejectedEvent, type FallbackSucceededEvent, type FallbackTelemetryEvent, type FallbackTimeoutEvent, type GateFailedEvent, type GatePassedEvent, type TelemetrySource, } from "./telemetryEvents.js";
|
|
4
|
+
export { buildEgressBlockedEvent, buildFiredEvent, buildGateFailedEvent, buildGatePassedEvent, buildRejectedEvent, buildSucceededEvent, buildTimeoutEvent, estimateCostUsd, FALLBACK_EVENTS, GATE_EVENTS, UNATTRIBUTED_ORGANISATION, type FallbackEgressBlockedEvent, type FallbackFiredEvent, type FallbackRejectedEvent, type FallbackSucceededEvent, type FallbackTelemetryEvent, type FallbackTimeoutEvent, type GateFailedEvent, type GatePassedEvent, type TelemetrySource, } from "./telemetryEvents.js";
|
|
4
5
|
export { PARSE_GATE, RUNTIME_GATE } from "./types.js";
|
|
5
|
-
export type { AnthropicClientProvider, AnthropicContentBlock, AnthropicResponse, ApplyResult, FallbackInput, FallbackIntent, FallbackOp, FallbackOutput, FallbackTelemetry, MorphClientProvider, MorphResponse, StrReplaceOp, TriggerReason, } from "./types.js";
|
|
6
|
+
export type { AnthropicClientProvider, AnthropicContentBlock, AnthropicResponse, ApplyResult, EgressStage, FallbackInput, FallbackIntent, FallbackOp, FallbackOutput, FallbackTelemetry, MorphClientProvider, MorphResponse, StrReplaceOp, TriggerReason, } from "./types.js";
|
|
6
7
|
export type { EgressGateResult, EgressRiskReason } from "./egressGate.types.js";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{runFallback as E}from"./runFallback.js";import{
|
|
1
|
+
import{runFallback as E}from"./runFallback.js";import{gateFallbackOutput as l}from"./gateFallbackOutput.js";import{shouldTryFallback as r}from"./shouldTryFallback.js";import{buildEgressBlockedEvent as a,buildFiredEvent as T,buildGateFailedEvent as i,buildGatePassedEvent as b,buildRejectedEvent as A,buildSucceededEvent as n,buildTimeoutEvent as s,estimateCostUsd as c,FALLBACK_EVENTS as m,GATE_EVENTS as v,UNATTRIBUTED_ORGANISATION as p}from"./telemetryEvents.js";import{PARSE_GATE as G,RUNTIME_GATE as N}from"./types.js";export{m as FALLBACK_EVENTS,v as GATE_EVENTS,G as PARSE_GATE,N as RUNTIME_GATE,p as UNATTRIBUTED_ORGANISATION,a as buildEgressBlockedEvent,T as buildFiredEvent,i as buildGateFailedEvent,b as buildGatePassedEvent,A as buildRejectedEvent,n as buildSucceededEvent,s as buildTimeoutEvent,c as estimateCostUsd,l as gateFallbackOutput,E as runFallback,r as shouldTryFallback};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
var m=Object.defineProperty;var c=(
|
|
1
|
+
var m=Object.defineProperty;var c=(t,o)=>m(t,"name",{value:o,configurable:!0});import{gateEgress as r}from"./egressGate.js";import{buildPrompt as T}from"./prompt.js";import{withTierTimeout as k}from"./tierRunner.js";import{PARSE_GATE as E}from"./types.js";const b=15e3,e="morph";async function _(t,o){if(!t.orgAllowsFallback)return{state:"disabled",reason:"org-opt-out"};if(!o.isAvailable())return{state:"disabled",reason:"env-flag"};const s=r(t.content,e,"input");if(s!==void 0)return s;const i=r(JSON.stringify(t.intent.properties),e,"input");if(i!==void 0)return i;const{systemPrompt:p,userPrompt:u}=T({content:t.content,intent:t.intent,tier:e});return k(t.abortSignal,e,b,async({signal:l,started:d})=>{const n=await o.apply({originalFile:t.content,update:`${p}
|
|
2
2
|
|
|
3
|
-
${u}`,signal:l}),f=Date.now()-d;if(n.content===
|
|
3
|
+
${u}`,signal:l}),f=Date.now()-d;if(n.content===t.content)return{state:"rejected",tier:e,failedGate:E,diagnostics:"Morph returned unchanged content"};const a=r(n.content,e,"output");if(a!==void 0)return a;const g={tier:e,elapsedMs:f,inputTokens:n.usage?.inputTokens??0,outputTokens:n.usage?.outputTokens??0,opsApplied:1};return{state:"applied",content:n.content,telemetry:g}})}c(_,"runMorphTier");export{_ as runMorphTier};
|
|
@@ -1,4 +1,7 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { ResourceSnapshot } from "../drift/index.js";
|
|
2
|
+
import type { GateId } from "../validationGate/types.js";
|
|
3
|
+
import { type GateEventAction } from "./gateFallbackOutput.js";
|
|
4
|
+
import { type AnthropicClientProvider, type FallbackInput, type FallbackOutput, type MorphClientProvider } from "./types.js";
|
|
2
5
|
export interface FallbackClients {
|
|
3
6
|
claude: AnthropicClientProvider;
|
|
4
7
|
morph?: MorphClientProvider;
|
|
@@ -9,5 +12,13 @@ export interface RunFallbackInput {
|
|
|
9
12
|
orgAllowsFallback: boolean;
|
|
10
13
|
morphTierEnabled: boolean;
|
|
11
14
|
abortSignal?: AbortSignal;
|
|
15
|
+
/**
|
|
16
|
+
* Drift baseline for the post-apply gate run. Optional — absent means the
|
|
17
|
+
* drift gate proceeds vacuously, matching the deterministic edit path when
|
|
18
|
+
* called without a baseline context.
|
|
19
|
+
*/
|
|
20
|
+
baseline?: ResourceSnapshot;
|
|
21
|
+
/** Per-gate observability hook for the post-apply validation chain. */
|
|
22
|
+
onGateResult?: (gate: GateId, action: GateEventAction, durationMs: number) => void;
|
|
12
23
|
}
|
|
13
24
|
export declare function runFallback(input: RunFallbackInput, clients: FallbackClients): Promise<FallbackOutput>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
var
|
|
1
|
+
var c=Object.defineProperty;var a=(e,t)=>c(e,"name",{value:t,configurable:!0});import{maskSensitiveOutput as s}from"@fjall/util";import{runClaudeTier as d}from"./claudeTier.js";import{gateFallbackOutput as u}from"./gateFallbackOutput.js";import{runMorphTier as b}from"./morphTier.js";import{RUNTIME_GATE as f}from"./types.js";function l(e,t){return{content:e.content,intent:e.intent,tier:t,orgAllowsFallback:e.orgAllowsFallback,abortSignal:e.abortSignal}}a(l,"buildTierInput");async function i(e,t,n){try{const r=await n();return r.state!=="applied"?r:u({outputContent:r.content,inputContent:e.content,intent:e.intent,tier:t,...e.baseline!==void 0&&{baseline:e.baseline},...e.abortSignal!==void 0&&{abortSignal:e.abortSignal},...e.onGateResult!==void 0&&{onGateResult:e.onGateResult}})??r}catch(r){return e.abortSignal?.aborted===!0?{state:"cancelled"}:{state:"rejected",tier:t,failedGate:f,diagnostics:s(r instanceof Error?r.message:String(r))}}}a(i,"runGatedTier");async function G(e,t){const n=await i(e,"claude",()=>d(l(e,"claude"),t.claude));if(!(n.state==="rejected"||n.state==="timeout"))return n;const o=t.morph;return!e.morphTierEnabled||o===void 0?n:i(e,"morph",()=>b(l(e,"morph"),o))}a(G,"runFallback");export{G as runFallback};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { GateId } from "../validationGate/types.js";
|
|
2
|
-
import type { FallbackOp, FallbackTelemetry, TriggerReason } from "./types.js";
|
|
2
|
+
import type { EgressStage, FallbackOp, FallbackTelemetry, TriggerReason } from "./types.js";
|
|
3
3
|
import type { EgressRiskReason } from "./egressGate.types.js";
|
|
4
4
|
import type { LlmFallbackTier } from "../types.js";
|
|
5
5
|
export declare const FALLBACK_EVENTS: {
|
|
@@ -13,6 +13,13 @@ export declare const GATE_EVENTS: {
|
|
|
13
13
|
readonly PASSED: "codemod.gate.passed";
|
|
14
14
|
readonly FAILED: "codemod.gate.failed";
|
|
15
15
|
};
|
|
16
|
+
/**
|
|
17
|
+
* Sentinel for events emitted before an organisation identity is resolved.
|
|
18
|
+
* Coupled value at 2+ consumers (CLI + webapp emitters): analytics forks
|
|
19
|
+
* silently if the spellings diverge, so import this — never inline the
|
|
20
|
+
* literal.
|
|
21
|
+
*/
|
|
22
|
+
export declare const UNATTRIBUTED_ORGANISATION = "unknown";
|
|
16
23
|
export type TelemetrySource = "cli" | "webapp_service" | "webapp_api" | "webapp_ui" | "mcp";
|
|
17
24
|
export interface FallbackFiredEvent {
|
|
18
25
|
event: typeof FALLBACK_EVENTS.FIRED;
|
|
@@ -64,6 +71,7 @@ export interface FallbackEgressBlockedEvent {
|
|
|
64
71
|
tier: LlmFallbackTier;
|
|
65
72
|
reason: EgressRiskReason;
|
|
66
73
|
count: number;
|
|
74
|
+
stage: EgressStage;
|
|
67
75
|
organisationId: string;
|
|
68
76
|
};
|
|
69
77
|
}
|
|
@@ -123,6 +131,7 @@ export declare function buildEgressBlockedEvent(params: {
|
|
|
123
131
|
tier: LlmFallbackTier;
|
|
124
132
|
reason: EgressRiskReason;
|
|
125
133
|
count: number;
|
|
134
|
+
stage: EgressStage;
|
|
126
135
|
organisationId: string;
|
|
127
136
|
}): FallbackEgressBlockedEvent;
|
|
128
137
|
export declare function buildGatePassedEvent(params: {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
var d=Object.defineProperty;var t=(e,n)=>d(e,"name",{value:n,configurable:!0});const o={FIRED:"codemod.llm_fallback.fired",SUCCEEDED:"codemod.llm_fallback.succeeded",REJECTED:"codemod.llm_fallback.rejected",TIMEOUT:"codemod.llm_fallback.timeout",EGRESS_BLOCKED:"codemod.llm_fallback.egress_blocked"},r={PASSED:"codemod.gate.passed",FAILED:"codemod.gate.failed"},i=3/1e6,u=15/1e6;function c(e){if(e.tier!=="claude")return 0;const n=e.inputTokens*i,E=e.outputTokens*u;return Math.round((n+E)*1e6)/1e6}t(c,"estimateCostUsd");function
|
|
1
|
+
var d=Object.defineProperty;var t=(e,n)=>d(e,"name",{value:n,configurable:!0});const o={FIRED:"codemod.llm_fallback.fired",SUCCEEDED:"codemod.llm_fallback.succeeded",REJECTED:"codemod.llm_fallback.rejected",TIMEOUT:"codemod.llm_fallback.timeout",EGRESS_BLOCKED:"codemod.llm_fallback.egress_blocked"},r={PASSED:"codemod.gate.passed",FAILED:"codemod.gate.failed"},s="unknown",i=3/1e6,u=15/1e6;function c(e){if(e.tier!=="claude")return 0;const n=e.inputTokens*i,E=e.outputTokens*u;return Math.round((n+E)*1e6)/1e6}t(c,"estimateCostUsd");function p(e){return{event:o.FIRED,properties:e}}t(p,"buildFiredEvent");function _(e){return{event:o.SUCCEEDED,properties:{source:e.source,operation:e.operation,tier:e.telemetry.tier,durationMs:e.telemetry.elapsedMs,estimatedCostUsd:c(e.telemetry),organisationId:e.organisationId}}}t(_,"buildSucceededEvent");function T(e){return{event:o.REJECTED,properties:e}}t(T,"buildRejectedEvent");function a(e){return{event:o.TIMEOUT,properties:e}}t(a,"buildTimeoutEvent");function D(e){return{event:o.EGRESS_BLOCKED,properties:e}}t(D,"buildEgressBlockedEvent");function f(e){return{event:r.PASSED,properties:e}}t(f,"buildGatePassedEvent");function C(e){return{event:r.FAILED,properties:e}}t(C,"buildGateFailedEvent");export{o as FALLBACK_EVENTS,r as GATE_EVENTS,s as UNATTRIBUTED_ORGANISATION,D as buildEgressBlockedEvent,p as buildFiredEvent,C as buildGateFailedEvent,f as buildGatePassedEvent,T as buildRejectedEvent,_ as buildSucceededEvent,a as buildTimeoutEvent,c as estimateCostUsd};
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import type { StatementType, ResourceName, LlmFallbackTier } from "../types.js";
|
|
2
2
|
import type { GateId } from "../validationGate/types.js";
|
|
3
|
-
import type { EgressRiskReason } from "./egressGate.types.js";
|
|
3
|
+
import type { EgressRiskReason, EgressStage } from "./egressGate.types.js";
|
|
4
|
+
export type { EgressStage } from "./egressGate.types.js";
|
|
4
5
|
export declare const PARSE_GATE: GateId;
|
|
5
6
|
export declare const RUNTIME_GATE: GateId;
|
|
6
7
|
export type FallbackOp = "add" | "modify" | "remove" | "resolve-drift-merge";
|
|
@@ -17,6 +18,12 @@ export interface FallbackInput {
|
|
|
17
18
|
orgAllowsFallback: boolean;
|
|
18
19
|
abortSignal?: AbortSignal;
|
|
19
20
|
}
|
|
21
|
+
/**
|
|
22
|
+
* `rejected.diagnostics` is pre-masked at construction — every construction
|
|
23
|
+
* site (tier rejections, `tierRunner` throw containment, `gateFallbackOutput`)
|
|
24
|
+
* routes dynamic content through `maskSensitiveOutput`. Consumers MUST NOT
|
|
25
|
+
* re-mask (security-standards § "One mask per output path").
|
|
26
|
+
*/
|
|
20
27
|
export type FallbackOutput = {
|
|
21
28
|
state: "applied";
|
|
22
29
|
content: string;
|
|
@@ -26,6 +33,7 @@ export type FallbackOutput = {
|
|
|
26
33
|
tier: LlmFallbackTier;
|
|
27
34
|
reason: EgressRiskReason;
|
|
28
35
|
count: number;
|
|
36
|
+
stage: EgressStage;
|
|
29
37
|
} | {
|
|
30
38
|
state: "timeout";
|
|
31
39
|
tier: LlmFallbackTier;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { z } from "zod";
|
|
2
2
|
import { ResourceNameSchema } from "../schemas/baseSchemas.js";
|
|
3
3
|
import type { GateId } from "./validationGate/types.js";
|
|
4
|
-
import type { EgressRiskReason } from "./llmFallback/egressGate.types.js";
|
|
4
|
+
import type { EgressRiskReason, EgressStage } from "./llmFallback/egressGate.types.js";
|
|
5
5
|
export declare const DriftPolicySchema: z.ZodObject<{
|
|
6
6
|
force: z.ZodOptional<z.ZodBoolean>;
|
|
7
7
|
resolutionMap: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
@@ -301,6 +301,12 @@ export interface ControlFlowClassifierError {
|
|
|
301
301
|
remediation?: string;
|
|
302
302
|
}
|
|
303
303
|
export type LlmFallbackTier = "claude" | "morph";
|
|
304
|
+
/**
|
|
305
|
+
* `diagnostics` is pre-masked at construction — the generator's tier
|
|
306
|
+
* rejections, throw containment and gate-chain rejections all route dynamic
|
|
307
|
+
* content through `maskSensitiveOutput` before it lands here (see
|
|
308
|
+
* `llmFallback/types.ts` § FallbackOutput). Consumers MUST NOT re-mask.
|
|
309
|
+
*/
|
|
304
310
|
export interface LlmFallbackRejectedError {
|
|
305
311
|
kind: "LlmFallbackRejectedError";
|
|
306
312
|
tier: LlmFallbackTier;
|
|
@@ -316,5 +322,7 @@ export interface LlmFallbackUnsafeInputError {
|
|
|
316
322
|
kind: "LlmFallbackUnsafeInputError";
|
|
317
323
|
reason: EgressRiskReason;
|
|
318
324
|
count: number;
|
|
325
|
+
/** Which egress scan fired — the pre-send input scan or the model-output scan. */
|
|
326
|
+
stage: EgressStage;
|
|
319
327
|
}
|
|
320
328
|
export type CodemodError = ParseError | TemplateLiteralNameError | DuplicateResourceError | ResourceNotFoundError | ReferencesRemainError | InvalidPropertyError | SemanticQueryError | MissingAppInitError | DriftConflictError | DriftUnmergeableError | PermissionError | ControlFlowClassifierError | LlmFallbackRejectedError | LlmFallbackTimeoutError | LlmFallbackUnsafeInputError;
|
|
@@ -2,5 +2,5 @@ export { runPipeline, runPipelineAsync, type AsyncGate, type Gate, type GateActi
|
|
|
2
2
|
export { driftGate } from "./gates/drift.js";
|
|
3
3
|
export { schemaGate } from "./gates/schema.js";
|
|
4
4
|
export { parseGate } from "./gates/parse.js";
|
|
5
|
-
export { locateGate } from "./gates/locate.js";
|
|
5
|
+
export { createLocateGate, locateGate, type LocateGateOptions, type LocateMode, } from "./gates/locate.js";
|
|
6
6
|
export { classifyGate } from "./gates/classify.js";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{runPipeline as
|
|
1
|
+
import{runPipeline as t,runPipelineAsync as o}from"./types.js";import{driftGate as p}from"./gates/drift.js";import{schemaGate as m}from"./gates/schema.js";import{parseGate as i}from"./gates/parse.js";import{createLocateGate as G,locateGate as n}from"./gates/locate.js";import{classifyGate as l}from"./gates/classify.js";export{l as classifyGate,G as createLocateGate,p as driftGate,n as locateGate,i as parseGate,t as runPipeline,o as runPipelineAsync,m as schemaGate};
|
|
@@ -24,7 +24,7 @@ ${l} certificates: [
|
|
|
24
24
|
],
|
|
25
25
|
records: ${d},
|
|
26
26
|
});
|
|
27
|
-
`}r(k,"generateDefaultInfrastructureTs");function g(t){return JSON.stringify({name:`domain-${t}`,version:u,scripts:{},devDependencies:{"@types/node":"20.4.9","ts-node":"^10.9.1",typescript:"~5.1.6"},dependencies:{"@fjall/components-infrastructure":`^${u}`,"aws-cdk-lib":"^2.
|
|
27
|
+
`}r(k,"generateDefaultInfrastructureTs");function g(t){return JSON.stringify({name:`domain-${t}`,version:u,scripts:{},devDependencies:{"@types/node":"20.4.9","ts-node":"^10.9.1",typescript:"~5.1.6"},dependencies:{"@fjall/components-infrastructure":`^${u}`,"aws-cdk-lib":"^2.265.0",constructs:"^10.7.2"}},null,2)+`
|
|
28
28
|
`}r(g,"generateDomainPackageJson");const y=`node_modules/
|
|
29
29
|
cdk.out/
|
|
30
30
|
*.d.ts
|
|
@@ -109,7 +109,7 @@ export interface DatabaseTierPreset {
|
|
|
109
109
|
* Only applies when capacityProvider is "EC2".
|
|
110
110
|
*/
|
|
111
111
|
export interface TierEc2CapacityConfig {
|
|
112
|
-
/** EC2 instance type. Default: "t4g.
|
|
112
|
+
/** EC2 instance type. Default: "t4g.small" (the constructs' ECS EC2 default) */
|
|
113
113
|
instanceType?: string;
|
|
114
114
|
/** AMI hardware type. Default: "ARM" for cost efficiency */
|
|
115
115
|
amiHardwareType?: "ARM" | "STANDARD";
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { z } from "zod";
|
|
2
2
|
export declare const EcsServiceAlarmConfigSchema: z.ZodUnion<readonly [z.ZodLiteral<false>, z.ZodObject<{
|
|
3
|
-
cpuThreshold: z.ZodOptional<z.ZodNumber
|
|
4
|
-
memoryThreshold: z.ZodOptional<z.ZodNumber
|
|
3
|
+
cpuThreshold: z.ZodOptional<z.ZodUnion<readonly [z.ZodNumber, z.ZodLiteral<false>]>>;
|
|
4
|
+
memoryThreshold: z.ZodOptional<z.ZodUnion<readonly [z.ZodNumber, z.ZodLiteral<false>]>>;
|
|
5
5
|
runningTasksMinimum: z.ZodOptional<z.ZodNumber>;
|
|
6
|
-
http5xxThreshold: z.ZodOptional<z.ZodNumber
|
|
6
|
+
http5xxThreshold: z.ZodOptional<z.ZodUnion<readonly [z.ZodNumber, z.ZodLiteral<false>]>>;
|
|
7
7
|
}, z.core.$strict>]>;
|
|
8
8
|
export declare const RdsAlarmConfigSchema: z.ZodUnion<readonly [z.ZodLiteral<false>, z.ZodObject<{
|
|
9
9
|
cpuThreshold: z.ZodOptional<z.ZodNumber>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{z as o}from"zod";import{VALIDATION_MESSAGES as n}from"../validation/patterns.js";const e=o.number().min(1,n.ALARM.PERCENTAGE.MIN).max(100,n.ALARM.PERCENTAGE.MAX),r=o.number().min(1,n.ALARM.FREE_STORAGE_GIB.MIN),
|
|
1
|
+
import{z as o}from"zod";import{VALIDATION_MESSAGES as n}from"../validation/patterns.js";const e=o.number().min(1,n.ALARM.PERCENTAGE.MIN).max(100,n.ALARM.PERCENTAGE.MAX),r=o.union([e,o.literal(!1)]),t=o.number().min(1,n.ALARM.FREE_STORAGE_GIB.MIN),l=o.union([o.literal(!1),o.object({cpuThreshold:r.optional(),memoryThreshold:r.optional(),runningTasksMinimum:o.number().int().min(0).optional(),http5xxThreshold:r.optional()}).strict()]),s=o.union([o.literal(!1),o.object({cpuThreshold:e.optional(),freeStorageThresholdGiB:t.optional(),connectionsThreshold:o.number().int().min(1).optional()}).strict()]),h=o.union([o.literal(!1),o.object({errorRateThreshold:e.optional(),durationThresholdPercent:e.optional()}).strict()]);export{l as EcsServiceAlarmConfigSchema,h as LambdaAlarmConfigSchema,s as RdsAlarmConfigSchema};
|
|
@@ -657,10 +657,10 @@ export declare const ApplicationResourcePlanSchema: z.ZodObject<{
|
|
|
657
657
|
sourceText: z.ZodString;
|
|
658
658
|
}, z.core.$strict>>>;
|
|
659
659
|
alarms: z.ZodOptional<z.ZodUnion<readonly [z.ZodLiteral<false>, z.ZodObject<{
|
|
660
|
-
cpuThreshold: z.ZodOptional<z.ZodNumber
|
|
661
|
-
memoryThreshold: z.ZodOptional<z.ZodNumber
|
|
660
|
+
cpuThreshold: z.ZodOptional<z.ZodUnion<readonly [z.ZodNumber, z.ZodLiteral<false>]>>;
|
|
661
|
+
memoryThreshold: z.ZodOptional<z.ZodUnion<readonly [z.ZodNumber, z.ZodLiteral<false>]>>;
|
|
662
662
|
runningTasksMinimum: z.ZodOptional<z.ZodNumber>;
|
|
663
|
-
http5xxThreshold: z.ZodOptional<z.ZodNumber
|
|
663
|
+
http5xxThreshold: z.ZodOptional<z.ZodUnion<readonly [z.ZodNumber, z.ZodLiteral<false>]>>;
|
|
664
664
|
}, z.core.$strict>]>>;
|
|
665
665
|
}, z.core.$strict>>>;
|
|
666
666
|
docker: z.ZodOptional<z.ZodObject<{
|
|
@@ -266,10 +266,10 @@ export declare const EcsServiceConfigSchema: z.ZodObject<{
|
|
|
266
266
|
sourceText: z.ZodString;
|
|
267
267
|
}, z.core.$strict>>>;
|
|
268
268
|
alarms: z.ZodOptional<z.ZodUnion<readonly [z.ZodLiteral<false>, z.ZodObject<{
|
|
269
|
-
cpuThreshold: z.ZodOptional<z.ZodNumber
|
|
270
|
-
memoryThreshold: z.ZodOptional<z.ZodNumber
|
|
269
|
+
cpuThreshold: z.ZodOptional<z.ZodUnion<readonly [z.ZodNumber, z.ZodLiteral<false>]>>;
|
|
270
|
+
memoryThreshold: z.ZodOptional<z.ZodUnion<readonly [z.ZodNumber, z.ZodLiteral<false>]>>;
|
|
271
271
|
runningTasksMinimum: z.ZodOptional<z.ZodNumber>;
|
|
272
|
-
http5xxThreshold: z.ZodOptional<z.ZodNumber
|
|
272
|
+
http5xxThreshold: z.ZodOptional<z.ZodUnion<readonly [z.ZodNumber, z.ZodLiteral<false>]>>;
|
|
273
273
|
}, z.core.$strict>]>>;
|
|
274
274
|
}, z.core.$strict>;
|
|
275
275
|
/**
|
|
@@ -419,10 +419,10 @@ export declare const ComputeResourcePlanSchema: z.ZodObject<{
|
|
|
419
419
|
sourceText: z.ZodString;
|
|
420
420
|
}, z.core.$strict>>>;
|
|
421
421
|
alarms: z.ZodOptional<z.ZodUnion<readonly [z.ZodLiteral<false>, z.ZodObject<{
|
|
422
|
-
cpuThreshold: z.ZodOptional<z.ZodNumber
|
|
423
|
-
memoryThreshold: z.ZodOptional<z.ZodNumber
|
|
422
|
+
cpuThreshold: z.ZodOptional<z.ZodUnion<readonly [z.ZodNumber, z.ZodLiteral<false>]>>;
|
|
423
|
+
memoryThreshold: z.ZodOptional<z.ZodUnion<readonly [z.ZodNumber, z.ZodLiteral<false>]>>;
|
|
424
424
|
runningTasksMinimum: z.ZodOptional<z.ZodNumber>;
|
|
425
|
-
http5xxThreshold: z.ZodOptional<z.ZodNumber
|
|
425
|
+
http5xxThreshold: z.ZodOptional<z.ZodUnion<readonly [z.ZodNumber, z.ZodLiteral<false>]>>;
|
|
426
426
|
}, z.core.$strict>]>>;
|
|
427
427
|
}, z.core.$strict>>>;
|
|
428
428
|
docker: z.ZodOptional<z.ZodObject<{
|
|
@@ -822,10 +822,10 @@ export declare const ComputeGeneratorSchema: z.ZodDiscriminatedUnion<[z.ZodObjec
|
|
|
822
822
|
sourceText: z.ZodString;
|
|
823
823
|
}, z.core.$strict>>>;
|
|
824
824
|
alarms: z.ZodOptional<z.ZodUnion<readonly [z.ZodLiteral<false>, z.ZodObject<{
|
|
825
|
-
cpuThreshold: z.ZodOptional<z.ZodNumber
|
|
826
|
-
memoryThreshold: z.ZodOptional<z.ZodNumber
|
|
825
|
+
cpuThreshold: z.ZodOptional<z.ZodUnion<readonly [z.ZodNumber, z.ZodLiteral<false>]>>;
|
|
826
|
+
memoryThreshold: z.ZodOptional<z.ZodUnion<readonly [z.ZodNumber, z.ZodLiteral<false>]>>;
|
|
827
827
|
runningTasksMinimum: z.ZodOptional<z.ZodNumber>;
|
|
828
|
-
http5xxThreshold: z.ZodOptional<z.ZodNumber
|
|
828
|
+
http5xxThreshold: z.ZodOptional<z.ZodUnion<readonly [z.ZodNumber, z.ZodLiteral<false>]>>;
|
|
829
829
|
}, z.core.$strict>]>>;
|
|
830
830
|
}, z.core.$strict>>;
|
|
831
831
|
docker: z.ZodOptional<z.ZodObject<{
|
package/dist/src/version.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const GENERATOR_VERSION = "
|
|
1
|
+
export declare const GENERATOR_VERSION = "12.1.0";
|
package/dist/src/version.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const E="
|
|
1
|
+
const E="12.1.0";export{E as GENERATOR_VERSION};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@fjall/generator",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "12.1.0",
|
|
4
4
|
"repository": {
|
|
5
5
|
"type": "git",
|
|
6
6
|
"url": "git+https://github.com/fjall-tech/fjall.git",
|
|
@@ -53,7 +53,7 @@
|
|
|
53
53
|
},
|
|
54
54
|
"license": "SEE LICENSE IN LICENSE",
|
|
55
55
|
"dependencies": {
|
|
56
|
-
"@fjall/util": "^
|
|
56
|
+
"@fjall/util": "^12.1.0",
|
|
57
57
|
"ast-types": "^0.16.1",
|
|
58
58
|
"recast": "^0.23.12",
|
|
59
59
|
"ts-morph": "^28.0.0",
|