avantgate 1.3.0 → 1.5.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/README.md +8 -3
- package/dist/agent/index.mjs +12 -279
- package/dist/agent/types.d.ts +5 -1
- package/dist/agent/types.d.ts.map +1 -1
- package/dist/chunk-4XWO3NZW.mjs +303 -0
- package/dist/chunk-5VA3EKPJ.mjs +344 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +531 -0
- package/dist/index.mjs +17 -3
- package/dist/workflow/define-workflow.d.ts +3 -0
- package/dist/workflow/define-workflow.d.ts.map +1 -0
- package/dist/workflow/engine.d.ts +3 -0
- package/dist/workflow/engine.d.ts.map +1 -0
- package/dist/workflow/errors.d.ts +31 -0
- package/dist/workflow/errors.d.ts.map +1 -0
- package/dist/workflow/index.d.ts +5 -0
- package/dist/workflow/index.d.ts.map +1 -0
- package/dist/workflow/index.js +611 -0
- package/dist/workflow/index.mjs +17 -0
- package/dist/workflow/types.d.ts +67 -0
- package/dist/workflow/types.d.ts.map +1 -0
- package/package.json +9 -3
- package/dist/chunk-DVCF4CSV.mjs +0 -56
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "avantgate",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.5.0",
|
|
4
4
|
"description": "Zero-infrastructure, in-process AI Application Firewall (AI-WAF) & privacy control plane for TypeScript: real-time prompt guardrails, zero-egress PII redaction, agent tool isolation, anti-IDOR defense, pre-flight token budgets, and multi-model failover.",
|
|
5
5
|
"author": "Antigravity & LexTalk Team",
|
|
6
6
|
"license": "MIT",
|
|
@@ -54,6 +54,11 @@
|
|
|
54
54
|
"import": "./dist/agent/index.mjs",
|
|
55
55
|
"require": "./dist/agent/index.js"
|
|
56
56
|
},
|
|
57
|
+
"./workflow": {
|
|
58
|
+
"types": "./dist/workflow/index.d.ts",
|
|
59
|
+
"import": "./dist/workflow/index.mjs",
|
|
60
|
+
"require": "./dist/workflow/index.js"
|
|
61
|
+
},
|
|
57
62
|
"./package.json": "./package.json"
|
|
58
63
|
},
|
|
59
64
|
"files": [
|
|
@@ -62,12 +67,13 @@
|
|
|
62
67
|
"LICENSE"
|
|
63
68
|
],
|
|
64
69
|
"scripts": {
|
|
65
|
-
"build": "tsup src/index.ts src/finance/index.ts src/agent/index.ts --format cjs --format esm --clean && tsc --emitDeclarationOnly --outDir dist",
|
|
66
|
-
"test": "tsx tests/avantgate.test.ts && tsx tests/preflight-budget.test.ts && tsx tests/financial-normalizer.test.ts && tsx tests/prompt-builder.test.ts && tsx tests/pii-extended.test.ts && npm run test:agent",
|
|
70
|
+
"build": "tsup src/index.ts src/finance/index.ts src/agent/index.ts src/workflow/index.ts --format cjs --format esm --clean && tsc --emitDeclarationOnly --outDir dist",
|
|
71
|
+
"test": "tsx tests/avantgate.test.ts && tsx tests/preflight-budget.test.ts && tsx tests/financial-normalizer.test.ts && tsx tests/prompt-builder.test.ts && tsx tests/pii-extended.test.ts && npm run test:agent && npm run test:workflow",
|
|
67
72
|
"test:finance": "tsx tests/financial-normalizer.test.ts",
|
|
68
73
|
"test:prompts": "tsx tests/prompt-builder.test.ts",
|
|
69
74
|
"test:pii": "tsx tests/pii-extended.test.ts",
|
|
70
75
|
"test:agent": "tsx tests/agent/step-runner.test.ts && tsx tests/agent/isolated-tool.test.ts && tsx tests/agent/dto-pattern.test.ts && tsx tests/agent/tool-patterns.test.ts && tsx tests/agent/storage-adapters.test.ts && tsx tests/agent/tool-aliasing.test.ts && tsx tests/agent/tool-chaining.test.ts && tsx tests/agent/tool-storage.test.ts && tsx tests/agent/telemetry-exporter.test.ts && tsx tests/agent/platform-adapter.test.ts && tsx tests/agent/tool-governance.test.ts && tsx tests/agent/tool-impact.test.ts",
|
|
76
|
+
"test:workflow": "tsx tests/workflow/workflow-saga.test.ts && tsx tests/workflow/workflow-abort.test.ts",
|
|
71
77
|
"lint": "tsc --noEmit",
|
|
72
78
|
"prepublishOnly": "npm run build && npm test"
|
|
73
79
|
},
|
package/dist/chunk-DVCF4CSV.mjs
DELETED
|
@@ -1,56 +0,0 @@
|
|
|
1
|
-
// src/sanitizer.ts
|
|
2
|
-
var EMAIL_REGEX = /\b[A-Za-z0-9._%+-]+@[A-Za-z0-9.-]+\.[A-Z|a-z]{2,7}\b/g;
|
|
3
|
-
var PHONE_FR_REGEX = /\b(?:(?:\+|00)33|0)\s*[1-9](?:[\s.-]*\d{2}){4}\b/g;
|
|
4
|
-
var NIR_SSN_REGEX = /\b[12]\s*\d{2}\s*(?:0[1-9]|1[0-2]|[2-9]\d)\s*(?:0[1-9]|[1-8]\d|9[0-8]|2[ABab])\s*(?!000)\d{3}\s*(?!000)\d{3}(?:\s*\d{2})?\b/g;
|
|
5
|
-
var SPI_LABELLED_REGEX = /(?:(?:num[ée]ro\s+fiscal|spi|n[°o]\s*fiscal|d[ée]clarant(?: fiscal)?)\s*[:=]?\s*)\b(\d{2}(?:[\s.-]?\d{2}){5}[\s.-]?\d|\d{13})\b/gi;
|
|
6
|
-
var SPI_FORMATTED_REGEX = /\b[0-3]\d(?:\s+\d{2}){5}\s+\d\b/g;
|
|
7
|
-
var IBAN_REGEX = /\b[A-Z]{2}\s*[0-9]{2}(?:[\s\r\n.-]*[A-Z0-9]){11,30}\b/g;
|
|
8
|
-
var BIC_LABELLED_REGEX = /(?:(?:bic|swift)\s*[:=]?\s*)\b([A-Z]{4}[A-Z]{2}[A-Z0-9]{2}(?:[A-Z0-9]{3})?)\b/gi;
|
|
9
|
-
function sanitizePII(input) {
|
|
10
|
-
let count = 0;
|
|
11
|
-
let result = input;
|
|
12
|
-
result = result.replace(EMAIL_REGEX, () => {
|
|
13
|
-
count++;
|
|
14
|
-
return "[REDACTED_EMAIL]";
|
|
15
|
-
});
|
|
16
|
-
result = result.replace(PHONE_FR_REGEX, () => {
|
|
17
|
-
count++;
|
|
18
|
-
return "[REDACTED_PHONE]";
|
|
19
|
-
});
|
|
20
|
-
result = result.replace(IBAN_REGEX, (match) => {
|
|
21
|
-
const cleanChars = match.replace(/[\s\r\n.-]/g, "");
|
|
22
|
-
if (cleanChars.length >= 15 && cleanChars.length <= 34) {
|
|
23
|
-
count++;
|
|
24
|
-
return "[REDACTED_IBAN]";
|
|
25
|
-
}
|
|
26
|
-
return match;
|
|
27
|
-
});
|
|
28
|
-
result = result.replace(BIC_LABELLED_REGEX, (_, bicCode) => {
|
|
29
|
-
count++;
|
|
30
|
-
return `[REDACTED_BIC: ${bicCode.slice(0, 4)}****]`;
|
|
31
|
-
});
|
|
32
|
-
result = result.replace(SPI_LABELLED_REGEX, (fullMatch, digits) => {
|
|
33
|
-
count++;
|
|
34
|
-
return fullMatch.replace(digits, "[REDACTED_SPI]");
|
|
35
|
-
});
|
|
36
|
-
result = result.replace(NIR_SSN_REGEX, (match) => {
|
|
37
|
-
const rawDigits = match.replace(/\s+/g, "");
|
|
38
|
-
if (rawDigits.length === 13 || rawDigits.length === 15) {
|
|
39
|
-
count++;
|
|
40
|
-
return "[REDACTED_NIR]";
|
|
41
|
-
}
|
|
42
|
-
return match;
|
|
43
|
-
});
|
|
44
|
-
result = result.replace(SPI_FORMATTED_REGEX, (match) => {
|
|
45
|
-
if (!match.includes("[REDACTED")) {
|
|
46
|
-
count++;
|
|
47
|
-
return "[REDACTED_SPI]";
|
|
48
|
-
}
|
|
49
|
-
return match;
|
|
50
|
-
});
|
|
51
|
-
return { text: result, maskedCount: count };
|
|
52
|
-
}
|
|
53
|
-
|
|
54
|
-
export {
|
|
55
|
-
sanitizePII
|
|
56
|
-
};
|