avantgate 1.1.2 → 1.2.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 (93) hide show
  1. package/dist/agent/adapters/custom-adapter.d.ts +50 -0
  2. package/dist/agent/adapters/custom-adapter.d.ts.map +1 -0
  3. package/dist/agent/adapters/index.d.ts +6 -0
  4. package/dist/agent/adapters/index.d.ts.map +1 -0
  5. package/dist/agent/adapters/memory-adapter.d.ts +34 -0
  6. package/dist/agent/adapters/memory-adapter.d.ts.map +1 -0
  7. package/dist/agent/adapters/platform-adapter.d.ts +32 -0
  8. package/dist/agent/adapters/platform-adapter.d.ts.map +1 -0
  9. package/dist/agent/adapters/prisma-adapter.d.ts +55 -0
  10. package/dist/agent/adapters/prisma-adapter.d.ts.map +1 -0
  11. package/dist/agent/adapters/sqlite-adapter.d.ts +31 -0
  12. package/dist/agent/adapters/sqlite-adapter.d.ts.map +1 -0
  13. package/dist/agent/dto.d.ts +32 -0
  14. package/dist/agent/dto.d.ts.map +1 -0
  15. package/dist/agent/errors.d.ts +50 -0
  16. package/dist/agent/errors.d.ts.map +1 -0
  17. package/dist/agent/factory.d.ts +21 -0
  18. package/dist/agent/factory.d.ts.map +1 -0
  19. package/dist/agent/guardrails.d.ts +14 -0
  20. package/dist/agent/guardrails.d.ts.map +1 -0
  21. package/dist/agent/index.d.ts +17 -742
  22. package/dist/agent/index.d.ts.map +1 -0
  23. package/dist/agent/index.js +203 -18
  24. package/dist/agent/index.mjs +202 -18
  25. package/dist/agent/isolated-tool.d.ts +9 -0
  26. package/dist/agent/isolated-tool.d.ts.map +1 -0
  27. package/dist/agent/registry.d.ts +71 -0
  28. package/dist/agent/registry.d.ts.map +1 -0
  29. package/dist/agent/step-runner.d.ts +12 -0
  30. package/dist/agent/step-runner.d.ts.map +1 -0
  31. package/dist/agent/strategy.d.ts +37 -0
  32. package/dist/agent/strategy.d.ts.map +1 -0
  33. package/dist/agent/telemetry/http-exporter.d.ts +24 -0
  34. package/dist/agent/telemetry/http-exporter.d.ts.map +1 -0
  35. package/dist/agent/telemetry/index.d.ts +3 -0
  36. package/dist/agent/telemetry/index.d.ts.map +1 -0
  37. package/dist/agent/telemetry/types.d.ts +92 -0
  38. package/dist/agent/telemetry/types.d.ts.map +1 -0
  39. package/dist/agent/tool-invoker.d.ts +17 -0
  40. package/dist/agent/tool-invoker.d.ts.map +1 -0
  41. package/dist/agent/tool-state.d.ts +7 -0
  42. package/dist/agent/tool-state.d.ts.map +1 -0
  43. package/dist/agent/types.d.ts +243 -0
  44. package/dist/agent/types.d.ts.map +1 -0
  45. package/dist/control-layer.d.ts +49 -0
  46. package/dist/control-layer.d.ts.map +1 -0
  47. package/dist/finance/factory.d.ts +11 -0
  48. package/dist/finance/factory.d.ts.map +1 -0
  49. package/dist/finance/index.d.ts +9 -76
  50. package/dist/finance/index.d.ts.map +1 -0
  51. package/dist/finance/normalizer.d.ts +19 -0
  52. package/dist/finance/normalizer.d.ts.map +1 -0
  53. package/dist/finance/strategies/french-pcg.strategy.d.ts +10 -0
  54. package/dist/finance/strategies/french-pcg.strategy.d.ts.map +1 -0
  55. package/dist/finance/strategies/international.strategy.d.ts +10 -0
  56. package/dist/finance/strategies/international.strategy.d.ts.map +1 -0
  57. package/dist/finance/strategies/swiss-co.strategy.d.ts +10 -0
  58. package/dist/finance/strategies/swiss-co.strategy.d.ts.map +1 -0
  59. package/dist/finance/strategies/uk-ifrs.strategy.d.ts +10 -0
  60. package/dist/finance/strategies/uk-ifrs.strategy.d.ts.map +1 -0
  61. package/dist/finance/strategies/us-gaap.strategy.d.ts +10 -0
  62. package/dist/finance/strategies/us-gaap.strategy.d.ts.map +1 -0
  63. package/dist/{strategy.interface-CB4_ZAuk.d.ts → finance/strategy.interface.d.ts} +5 -6
  64. package/dist/finance/strategy.interface.d.ts.map +1 -0
  65. package/dist/index.d.ts +9 -390
  66. package/dist/index.d.ts.map +1 -0
  67. package/dist/input-guard.d.ts +13 -0
  68. package/dist/input-guard.d.ts.map +1 -0
  69. package/dist/pricing.d.ts +49 -0
  70. package/dist/pricing.d.ts.map +1 -0
  71. package/dist/prompts/index.d.ts +5 -0
  72. package/dist/prompts/index.d.ts.map +1 -0
  73. package/dist/prompts/prompt-builder.d.ts +31 -0
  74. package/dist/prompts/prompt-builder.d.ts.map +1 -0
  75. package/dist/prompts/prompt-registry.d.ts +13 -0
  76. package/dist/prompts/prompt-registry.d.ts.map +1 -0
  77. package/dist/prompts/prompt-template.d.ts +17 -0
  78. package/dist/prompts/prompt-template.d.ts.map +1 -0
  79. package/dist/prompts/types.d.ts +39 -0
  80. package/dist/prompts/types.d.ts.map +1 -0
  81. package/dist/providers/http-client.d.ts +18 -0
  82. package/dist/providers/http-client.d.ts.map +1 -0
  83. package/dist/response-validator.d.ts +18 -0
  84. package/dist/response-validator.d.ts.map +1 -0
  85. package/dist/sanitizer.d.ts +11 -0
  86. package/dist/sanitizer.d.ts.map +1 -0
  87. package/dist/types.d.ts +146 -0
  88. package/dist/types.d.ts.map +1 -0
  89. package/package.json +3 -3
  90. package/dist/agent/index.d.mts +0 -743
  91. package/dist/finance/index.d.mts +0 -76
  92. package/dist/index.d.mts +0 -390
  93. package/dist/strategy.interface-CB4_ZAuk.d.mts +0 -16
@@ -0,0 +1,49 @@
1
+ import type { ModelPrice, PricingAdapter } from "./types";
2
+ export type { ModelPrice, PricingAdapter };
3
+ export interface CalculateCostOptions {
4
+ provider?: string;
5
+ providerPricing?: ModelPrice;
6
+ customPricing?: Record<string, ModelPrice>;
7
+ adapter?: PricingAdapter;
8
+ }
9
+ /**
10
+ * Catalogue indicatif non injecté par défaut dans le moteur.
11
+ * Les utilisateurs peuvent s'en servir comme jeu de données initial (ex: seed Prisma)
12
+ * ou pour peupler le PricingRegistry s'ils souhaitent des valeurs de départ.
13
+ */
14
+ export declare const SEED_MODEL_PRICES: Record<string, ModelPrice>;
15
+ export declare class CachedPricingAdapter implements PricingAdapter {
16
+ private cache;
17
+ private ttlMs;
18
+ private delegate;
19
+ constructor(delegate: PricingAdapter, ttlMs?: number);
20
+ fetchPrice(model: string, provider?: string): Promise<ModelPrice | undefined>;
21
+ peek(model: string, provider?: string): ModelPrice | undefined;
22
+ clearCache(): void;
23
+ invalidate(model?: string, provider?: string): void;
24
+ }
25
+ /**
26
+ * Registre de tarification dynamique.
27
+ * Démarre 100% vide : aucune valeur codée en dur n'est imposée par défaut (Option A : Strict & Truthful).
28
+ */
29
+ export declare class PricingRegistry {
30
+ private static prices;
31
+ private static adapter?;
32
+ static registerPrice(identifier: string, price: ModelPrice): void;
33
+ static registerDistributorPrices(distributor: string, priceMap: Record<string, ModelPrice>): void;
34
+ static registerPrices(prices: Record<string, ModelPrice>): void;
35
+ static getPrice(model: string, provider?: string): ModelPrice | undefined;
36
+ static setAdapter(adapter: PricingAdapter): void;
37
+ static getAdapter(): PricingAdapter | undefined;
38
+ static clear(): void;
39
+ /**
40
+ * Réinitialise le registre en chargeant le catalogue d'exemple SEED_MODEL_PRICES.
41
+ */
42
+ static loadSeedPrices(): void;
43
+ static getAllPrices(): Record<string, ModelPrice>;
44
+ }
45
+ export declare const DEFAULT_MODEL_PRICES: Record<string, ModelPrice>;
46
+ export declare function resolveModelPrice(model: string, options?: CalculateCostOptions | string): ModelPrice | undefined;
47
+ export declare function resolveModelPriceAsync(model: string, options?: CalculateCostOptions | string): Promise<ModelPrice | undefined>;
48
+ export declare function calculateCostUSD(model: string, promptTokens: number, completionTokens: number, cacheHitTokens?: number, options?: CalculateCostOptions | string): number;
49
+ //# sourceMappingURL=pricing.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"pricing.d.ts","sourceRoot":"","sources":["../src/pricing.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,cAAc,EAAE,MAAM,SAAS,CAAC;AAC1D,YAAY,EAAE,UAAU,EAAE,cAAc,EAAE,CAAC;AAE3C,MAAM,WAAW,oBAAoB;IACnC,QAAQ,CAAC,EAAE,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AAQ,CAAC,EAAE,MAAM,GAAG,UAAU,GAAG,SAAS;IAWzE,MAAM,CAAC,UAAU,CAAC,OAAO,EAAE,cAAc,GAAG,IAAI;IAIhD,MAAM,CAAC,UAAU,IAAI,cAAc,GAAG,SAAS;IAI/C,MAAM,CAAC,KAAK,IAAI,IAAI;IAKpB;;OAEG;IACH,MAAM,CAAC,cAAc,IAAI,IAAI;IAI7B,MAAM,CAAC,YAAY,IAAI,MAAM,CAAC,MAAM,EAAE,UAAU,CAAC;CAOlD;AAGD,eAAO,MAAM,oBAAoB,EAAE,MAAM,CAAC,MAAM,EAAE,UAAU,CAiB1D,CAAC;AAEH,wBAAgB,iBAAiB,CAC/B,KAAK,EAAE,MAAM,EACb,OAAO,CAAC,EAAE,oBAAoB,GAAG,MAAM,GACtC,UAAU,GAAG,SAAS,CA2CxB;AAED,wBAAsB,sBAAsB,CAC1C,KAAK,EAAE,MAAM,EACb,OAAO,CAAC,EAAE,oBAAoB,GAAG,MAAM,GACtC,OAAO,CAAC,UAAU,GAAG,SAAS,CAAC,CAiBjC;AAED,wBAAgB,gBAAgB,CAC9B,KAAK,EAAE,MAAM,EACb,YAAY,EAAE,MAAM,EACpB,gBAAgB,EAAE,MAAM,EACxB,cAAc,GAAE,MAAU,EAC1B,OAAO,CAAC,EAAE,oBAAoB,GAAG,MAAM,GACtC,MAAM,CAcR"}
@@ -0,0 +1,5 @@
1
+ export * from "./types";
2
+ export * from "./prompt-template";
3
+ export * from "./prompt-builder";
4
+ export * from "./prompt-registry";
5
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/prompts/index.ts"],"names":[],"mappings":"AAAA,cAAc,SAAS,CAAC;AACxB,cAAc,mBAAmB,CAAC;AAClC,cAAc,kBAAkB,CAAC;AACjC,cAAc,mBAAmB,CAAC"}
@@ -0,0 +1,31 @@
1
+ import { z } from "zod";
2
+ import type { PromptMessage, BuildResult, ITokenBudget } from "./types";
3
+ import { PromptTemplate } from "./prompt-template";
4
+ export declare class PromptBuilder {
5
+ private personaSlot;
6
+ private rulesSlot;
7
+ private retryHintSlot;
8
+ private fewShotSlot;
9
+ private pinnedFactsSlot;
10
+ private contextSlot;
11
+ private userPayloadSlot;
12
+ private schemaContractText;
13
+ constructor(templateOrId?: string | PromptTemplate);
14
+ withPersona(persona: string): this;
15
+ withRules(rules: string | string[]): this;
16
+ withRetryHint(hint: string): this;
17
+ withFewShot(examples: Array<{
18
+ question: string;
19
+ answer: string;
20
+ }>): this;
21
+ withPinnedFacts(facts: string | Record<string, unknown>): this;
22
+ withContext(context: string): this;
23
+ withUserPayload(payload: string): this;
24
+ schemaContract<T>(schema: z.ZodType<T>, options?: {
25
+ schemaName?: string;
26
+ }): this;
27
+ private assembleMessages;
28
+ toMessages(): PromptMessage[];
29
+ build(budget?: ITokenBudget): BuildResult;
30
+ }
31
+ //# sourceMappingURL=prompt-builder.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"prompt-builder.d.ts","sourceRoot":"","sources":["../../src/prompts/prompt-builder.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,KAAK,EACV,aAAa,EACb,WAAW,EACX,YAAY,EACb,MAAM,SAAS,CAAC;AACjB,OAAO,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AAEnD,qBAAa,aAAa;IACxB,OAAO,CAAC,WAAW,CAAM;IACzB,OAAO,CAAC,SAAS,CAAgB;IACjC,OAAO,CAAC,aAAa,CAAM;IAC3B,OAAO,CAAC,WAAW,CAAmD;IACtE,OAAO,CAAC,eAAe,CAAM;IAC7B,OAAO,CAAC,WAAW,CAAM;IACzB,OAAO,CAAC,eAAe,CAAM;IAC7B,OAAO,CAAC,kBAAkB,CAAM;gBAEpB,YAAY,CAAC,EAAE,MAAM,GAAG,cAAc;IAQ3C,WAAW,CAAC,OAAO,EAAE,MAAM,GAAG,IAAI;IAKlC,SAAS,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,EAAE,GAAG,IAAI;IASzC,aAAa,CAAC,IAAI,EAAE,MAAM,GAAG,IAAI;IAKjC,WAAW,CAAC,QAAQ,EAAE,KAAK,CAAC;QAAE,QAAQ,EAAE,MAAM,CAAC;QAAC,MAAM,EAAE,MAAM,CAAA;KAAE,CAAC,GAAG,IAAI;IAKxE,eAAe,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,IAAI;IAc9D,WAAW,CAAC,OAAO,EAAE,MAAM,GAAG,IAAI;IAKlC,eAAe,CAAC,OAAO,EAAE,MAAM,GAAG,IAAI;IAKtC,cAAc,CAAC,CAAC,EAAE,MAAM,EAAE,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,EAAE,OAAO,CAAC,EAAE;QAAE,UAAU,CAAC,EAAE,MAAM,CAAA;KAAE,GAAG,IAAI;IAmBvF,OAAO,CAAC,gBAAgB;IAwDjB,UAAU,IAAI,aAAa,EAAE;IAI7B,KAAK,CAAC,MAAM,CAAC,EAAE,YAAY,GAAG,WAAW;CA+EjD"}
@@ -0,0 +1,13 @@
1
+ import { PromptTemplate } from "./prompt-template";
2
+ import type { PromptTemplateOptions, PromptLabel } from "./types";
3
+ export declare class PromptRegistry {
4
+ private static registry;
5
+ static register<T extends Record<string, unknown>>(templateOrOptions: PromptTemplate<T> | PromptTemplateOptions<T>): void;
6
+ static get<T extends Record<string, unknown> = Record<string, unknown>>(id: string, options?: {
7
+ version?: number;
8
+ label?: PromptLabel;
9
+ }): PromptTemplate<T>;
10
+ static has(id: string): boolean;
11
+ static clear(): void;
12
+ }
13
+ //# sourceMappingURL=prompt-registry.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"prompt-registry.d.ts","sourceRoot":"","sources":["../../src/prompts/prompt-registry.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AACnD,OAAO,KAAK,EAAE,qBAAqB,EAAE,WAAW,EAAE,MAAM,SAAS,CAAC;AAElE,qBAAa,cAAc;IACzB,OAAO,CAAC,MAAM,CAAC,QAAQ,CAAiD;WAE1D,QAAQ,CAAC,CAAC,SAAS,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EACtD,iBAAiB,EAAE,cAAc,CAAC,CAAC,CAAC,GAAG,qBAAqB,CAAC,CAAC,CAAC,GAC9D,IAAI;WAeO,GAAG,CAAC,CAAC,SAAS,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAC3E,EAAE,EAAE,MAAM,EACV,OAAO,CAAC,EAAE;QAAE,OAAO,CAAC,EAAE,MAAM,CAAC;QAAC,KAAK,CAAC,EAAE,WAAW,CAAA;KAAE,GAClD,cAAc,CAAC,CAAC,CAAC;WA2BN,GAAG,CAAC,EAAE,EAAE,MAAM,GAAG,OAAO;WAIxB,KAAK,IAAI,IAAI;CAG5B"}
@@ -0,0 +1,17 @@
1
+ import { z } from "zod";
2
+ import type { PromptTemplateOptions, PromptValidationResult, PromptLabel } from "./types";
3
+ export declare class PromptTemplate<TVariables extends Record<string, unknown> = Record<string, unknown>> {
4
+ readonly id: string;
5
+ readonly version: number;
6
+ readonly label: PromptLabel;
7
+ readonly description?: string;
8
+ readonly template: string;
9
+ readonly inputSchema?: z.ZodType<TVariables>;
10
+ private blockPatterns;
11
+ private antiInjectionEnabled;
12
+ private customSanitizer?;
13
+ constructor(options: PromptTemplateOptions<TVariables>);
14
+ validateUserInput(variables: TVariables): PromptValidationResult;
15
+ format(variables: TVariables): string;
16
+ }
17
+ //# sourceMappingURL=prompt-template.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"prompt-template.d.ts","sourceRoot":"","sources":["../../src/prompts/prompt-template.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,KAAK,EACV,qBAAqB,EACrB,sBAAsB,EACtB,WAAW,EACZ,MAAM,SAAS,CAAC;AAWjB,qBAAa,cAAc,CACzB,UAAU,SAAS,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC;IAEpE,QAAQ,CAAC,EAAE,EAAE,MAAM,CAAC;IACpB,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;IACzB,QAAQ,CAAC,KAAK,EAAE,WAAW,CAAC;IAC5B,QAAQ,CAAC,WAAW,CAAC,EAAE,MAAM,CAAC;IAC9B,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;IAC1B,QAAQ,CAAC,WAAW,CAAC,EAAE,CAAC,CAAC,OAAO,CAAC,UAAU,CAAC,CAAC;IAC7C,OAAO,CAAC,aAAa,CAAW;IAChC,OAAO,CAAC,oBAAoB,CAAU;IACtC,OAAO,CAAC,eAAe,CAAC,CAA4B;gBAExC,OAAO,EAAE,qBAAqB,CAAC,UAAU,CAAC;IAY/C,iBAAiB,CAAC,SAAS,EAAE,UAAU,GAAG,sBAAsB;IAgChE,MAAM,CAAC,SAAS,EAAE,UAAU,GAAG,MAAM;CA0B7C"}
@@ -0,0 +1,39 @@
1
+ import { z } from "zod";
2
+ export interface PromptMessage {
3
+ role: "system" | "user" | "assistant";
4
+ content: string;
5
+ }
6
+ export type PromptLabel = "production" | "staging" | "experimental";
7
+ export interface PromptTemplateOptions<TVariables extends Record<string, unknown> = Record<string, unknown>> {
8
+ id: string;
9
+ version: number;
10
+ label?: PromptLabel;
11
+ description?: string;
12
+ template: string;
13
+ inputSchema?: z.ZodType<TVariables>;
14
+ antiInjection?: {
15
+ enabled?: boolean;
16
+ blockPatterns?: RegExp[];
17
+ sanitizer?: (value: string) => string;
18
+ };
19
+ }
20
+ export interface PromptValidationResult {
21
+ isValid: boolean;
22
+ threats: string[];
23
+ }
24
+ export interface ITokenBudget {
25
+ count(text: string): number;
26
+ remaining(): number;
27
+ reserve(slot: string, text: string): void;
28
+ forceReserve(slot: string, text: string): void;
29
+ getAllocated(): number;
30
+ reset(): void;
31
+ }
32
+ export interface BuildResult {
33
+ messages: PromptMessage[];
34
+ promptText: string;
35
+ allocatedTokens?: number;
36
+ isTruncated: boolean;
37
+ truncatedSlot?: "context" | "pinnedFacts" | "user";
38
+ }
39
+ //# sourceMappingURL=types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/prompts/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,MAAM,WAAW,aAAa;IAC5B,IAAI,EAAE,QAAQ,GAAG,MAAM,GAAG,WAAW,CAAC;IACtC,OAAO,EAAE,MAAM,CAAC;CACjB;AAED,MAAM,MAAM,WAAW,GAAG,YAAY,GAAG,SAAS,GAAG,cAAc,CAAC;AAEpE,MAAM,WAAW,qBAAqB,CAAC,UAAU,SAAS,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC;IACzG,EAAE,EAAE,MAAM,CAAC;IACX,OAAO,EAAE,MAAM,CAAC;IAChB,KAAK,CAAC,EAAE,WAAW,CAAC;IACpB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,QAAQ,EAAE,MAAM,CAAC;IACjB,WAAW,CAAC,EAAE,CAAC,CAAC,OAAO,CAAC,UAAU,CAAC,CAAC;IACpC,aAAa,CAAC,EAAE;QACd,OAAO,CAAC,EAAE,OAAO,CAAC;QAClB,aAAa,CAAC,EAAE,MAAM,EAAE,CAAC;QACzB,SAAS,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,MAAM,CAAC;KACvC,CAAC;CACH;AAED,MAAM,WAAW,sBAAsB;IACrC,OAAO,EAAE,OAAO,CAAC;IACjB,OAAO,EAAE,MAAM,EAAE,CAAC;CACnB;AAED,MAAM,WAAW,YAAY;IAC3B,KAAK,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAAC;IAC5B,SAAS,IAAI,MAAM,CAAC;IACpB,OAAO,CAAC,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,GAAG,IAAI,CAAC;IAC1C,YAAY,CAAC,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,GAAG,IAAI,CAAC;IAC/C,YAAY,IAAI,MAAM,CAAC;IACvB,KAAK,IAAI,IAAI,CAAC;CACf;AAED,MAAM,WAAW,WAAW;IAC1B,QAAQ,EAAE,aAAa,EAAE,CAAC;IAC1B,UAAU,EAAE,MAAM,CAAC;IACnB,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,WAAW,EAAE,OAAO,CAAC;IACrB,aAAa,CAAC,EAAE,SAAS,GAAG,aAAa,GAAG,MAAM,CAAC;CACpD"}
@@ -0,0 +1,18 @@
1
+ import type { LLMProviderPort, LLMCompletionOptions, LLMUsage, ProviderConfig } from "../types";
2
+ export declare class HttpProviderClient implements LLMProviderPort {
3
+ readonly name: string;
4
+ private readonly baseUrl;
5
+ private readonly apiKey?;
6
+ private readonly providerType;
7
+ constructor(config: ProviderConfig);
8
+ private resolveEndpoint;
9
+ private buildHeaders;
10
+ private buildPayload;
11
+ private extractUsage;
12
+ complete(options: LLMCompletionOptions): Promise<{
13
+ text: string;
14
+ usage?: LLMUsage;
15
+ }>;
16
+ }
17
+ export declare function createHttpProviderClient(config: ProviderConfig): HttpProviderClient;
18
+ //# sourceMappingURL=http-client.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"http-client.d.ts","sourceRoot":"","sources":["../../src/providers/http-client.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,eAAe,EACf,oBAAoB,EACpB,QAAQ,EAER,cAAc,EACf,MAAM,UAAU,CAAC;AA+BlB,qBAAa,kBAAmB,YAAW,eAAe;IACxD,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAS;IACjC,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAS;IACjC,OAAO,CAAC,QAAQ,CAAC,YAAY,CAAS;gBAE1B,MAAM,EAAE,cAAc;IAOlC,OAAO,CAAC,eAAe;IAQvB,OAAO,CAAC,YAAY;IAiBpB,OAAO,CAAC,YAAY;IAYpB,OAAO,CAAC,YAAY;IAYd,QAAQ,CAAC,OAAO,EAAE,oBAAoB,GAAG,OAAO,CAAC;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,KAAK,CAAC,EAAE,QAAQ,CAAA;KAAE,CAAC;CAyB3F;AAED,wBAAgB,wBAAwB,CAAC,MAAM,EAAE,cAAc,GAAG,kBAAkB,CAEnF"}
@@ -0,0 +1,18 @@
1
+ import { z } from "zod";
2
+ import type { FinancialJurisdictionCode } from "./finance/strategy.interface";
3
+ export interface ValidateOptions {
4
+ normalizer?: (rawText: string) => string;
5
+ financialNormalizer?: boolean;
6
+ jurisdiction?: FinancialJurisdictionCode;
7
+ }
8
+ /**
9
+ * Nettoie et extrait un bloc JSON valide depuis une réponse de LLM
10
+ * (gère les blocs markdown ```json ... ```, les balises de réflexion, etc.)
11
+ */
12
+ export declare function extractAndCleanJSON(rawText: string): string;
13
+ /**
14
+ * Valide et auto-répare une sortie JSON contre un schéma Zod.
15
+ * Supporte l'option de normalisation financière (parenthèses négatives, formats comptables).
16
+ */
17
+ export declare function validateWithZod<T>(rawText: string, schema: z.ZodType<T>, options?: ValidateOptions): T;
18
+ //# sourceMappingURL=response-validator.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"response-validator.d.ts","sourceRoot":"","sources":["../src/response-validator.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,8BAA8B,CAAC;AAE9E,MAAM,WAAW,eAAe;IAC9B,UAAU,CAAC,EAAE,CAAC,OAAO,EAAE,MAAM,KAAK,MAAM,CAAC;IACzC,mBAAmB,CAAC,EAAE,OAAO,CAAC;IAC9B,YAAY,CAAC,EAAE,yBAAyB,CAAC;CAC1C;AAED;;;GAGG;AACH,wBAAgB,mBAAmB,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,CAkC3D;AAED;;;GAGG;AACH,wBAAgB,eAAe,CAAC,CAAC,EAC/B,OAAO,EAAE,MAAM,EACf,MAAM,EAAE,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,EACpB,OAAO,CAAC,EAAE,eAAe,GACxB,CAAC,CAsBH"}
@@ -0,0 +1,11 @@
1
+ /**
2
+ * In-Flight PII Sanitizer for AvantGate.
3
+ * Masque les données sensibles (email, téléphone, NIR/sécurité sociale, IBAN/BIC, numéro fiscal SPI)
4
+ * avant l'envoi vers des API cloud.
5
+ */
6
+ export interface SanitizeResult {
7
+ text: string;
8
+ maskedCount: number;
9
+ }
10
+ export declare function sanitizePII(input: string): SanitizeResult;
11
+ //# sourceMappingURL=sanitizer.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"sanitizer.d.ts","sourceRoot":"","sources":["../src/sanitizer.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAkBH,MAAM,WAAW,cAAc;IAC7B,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,EAAE,MAAM,CAAC;CACrB;AAED,wBAAgB,WAAW,CAAC,KAAK,EAAE,MAAM,GAAG,cAAc,CA2DzD"}
@@ -0,0 +1,146 @@
1
+ import { z } from "zod";
2
+ export interface ChatMessage {
3
+ role: "system" | "user" | "assistant" | "tool";
4
+ content: string;
5
+ }
6
+ export interface LLMUsage {
7
+ promptTokens?: number;
8
+ completionTokens?: number;
9
+ totalTokens?: number;
10
+ promptCacheHitTokens?: number;
11
+ promptCacheMissTokens?: number;
12
+ }
13
+ export interface LLMCompletionOptions {
14
+ model?: string;
15
+ messages: ChatMessage[];
16
+ temperature?: number;
17
+ responseFormat?: Record<string, unknown>;
18
+ }
19
+ export interface LLMStructuredOutputOptions<T> {
20
+ model?: string;
21
+ messages: ChatMessage[];
22
+ schema: z.ZodType<T>;
23
+ schemaName: string;
24
+ temperature?: number;
25
+ }
26
+ export interface LLMProviderPort {
27
+ readonly name: string;
28
+ complete(options: LLMCompletionOptions): Promise<{
29
+ text: string;
30
+ usage?: LLMUsage;
31
+ }>;
32
+ stream?(options: LLMCompletionOptions): AsyncGenerator<string, LLMUsage | undefined>;
33
+ generateStructuredOutput?<T>(options: LLMStructuredOutputOptions<T>): Promise<T>;
34
+ }
35
+ export interface ModelPrice {
36
+ promptUSDPerMillion: number;
37
+ completionUSDPerMillion: number;
38
+ cacheHitUSDPerMillion?: number;
39
+ }
40
+ export interface PricingAdapter {
41
+ fetchPrice(model: string, provider?: string): Promise<ModelPrice | undefined> | ModelPrice | undefined;
42
+ }
43
+ export declare class ConfigurationError extends Error {
44
+ constructor(message: string);
45
+ }
46
+ export declare class BudgetExceededError extends Error {
47
+ constructor(message: string);
48
+ }
49
+ export { ConfigurationError as AvantGateConfigurationError };
50
+ export { BudgetExceededError as AvantGateBudgetExceededError };
51
+ export interface ProviderConfig {
52
+ provider: "deepseek" | "mistral" | "openai" | "ollama" | "openrouter" | "custom";
53
+ model: string;
54
+ apiKey?: string;
55
+ baseUrl?: string;
56
+ client?: LLMProviderPort;
57
+ pricing?: ModelPrice;
58
+ }
59
+ export interface SecurityConfig {
60
+ detectPromptInjection?: boolean;
61
+ maskPII?: boolean;
62
+ maxInputLength?: number;
63
+ }
64
+ export interface RetryConfig {
65
+ maxRetries?: number;
66
+ initialDelayMs?: number;
67
+ backoffFactor?: number;
68
+ }
69
+ export interface AuditRecord {
70
+ timestamp: Date;
71
+ model: string;
72
+ tokens: {
73
+ prompt: number;
74
+ completion: number;
75
+ total: number;
76
+ };
77
+ costUSD: number;
78
+ failoverOccurred: boolean;
79
+ attempts: number;
80
+ durationMs?: number;
81
+ }
82
+ export interface AuditSinkPort {
83
+ readonly name: string;
84
+ log(record: AuditRecord): Promise<void> | void;
85
+ }
86
+ export interface FinanceFeaturesConfig {
87
+ enableFrenchAccounting?: boolean;
88
+ stripCurrencySymbols?: boolean;
89
+ jurisdiction?: "FR" | "US" | "UK" | "CH" | "INTERNATIONAL";
90
+ autoDetect?: boolean;
91
+ }
92
+ export interface FeaturesConfig {
93
+ finance?: FinanceFeaturesConfig;
94
+ }
95
+ export interface ControlLayerConfig {
96
+ primary: ProviderConfig;
97
+ fallback?: ProviderConfig;
98
+ emergencyFallback?: ProviderConfig;
99
+ retryOptions?: RetryConfig;
100
+ auditSink?: AuditSinkPort;
101
+ maxTokenBudget?: number;
102
+ maxCostUSD?: number;
103
+ security?: SecurityConfig;
104
+ hourlyTokenLimit?: number;
105
+ dailyTokenLimit?: number;
106
+ features?: FeaturesConfig;
107
+ pricingAdapter?: PricingAdapter;
108
+ pricingCacheTtlMs?: number;
109
+ customPricing?: Record<string, ModelPrice>;
110
+ mockSimulation?: boolean;
111
+ }
112
+ export interface ExecutionResult {
113
+ text: string;
114
+ tokens: {
115
+ prompt: number;
116
+ completion: number;
117
+ total: number;
118
+ };
119
+ costUSD: number;
120
+ modelUsed: string;
121
+ failoverOccurred: boolean;
122
+ attempts: number;
123
+ }
124
+ export interface StructuredExecutionResult<T> {
125
+ data: T;
126
+ rawText: string;
127
+ tokens: {
128
+ prompt: number;
129
+ completion: number;
130
+ total: number;
131
+ };
132
+ costUSD: number;
133
+ modelUsed: string;
134
+ failoverOccurred: boolean;
135
+ }
136
+ export interface GenerateStructuredOutputOptions<T> {
137
+ model?: string;
138
+ messages: ChatMessage[];
139
+ schema: z.ZodType<T>;
140
+ schemaName?: string;
141
+ maxRetries?: number;
142
+ temperature?: number;
143
+ providerOverride?: LLMProviderPort;
144
+ financialNormalizer?: boolean;
145
+ }
146
+ //# sourceMappingURL=types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAA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,aAAa,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,UAAU,CAAC,CAAC;IAC3C,cAAc,CAAC,EAAE,OAAO,CAAC;CAC1B;AAED,MAAM,WAAW,eAAe;IAC9B,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE;QACN,MAAM,EAAE,MAAM,CAAC;QACf,UAAU,EAAE,MAAM,CAAC;QACnB,KAAK,EAAE,MAAM,CAAC;KACf,CAAC;IACF,OAAO,EAAE,MAAM,CAAC;IAChB,SAAS,EAAE,MAAM,CAAC;IAClB,gBAAgB,EAAE,OAAO,CAAC;IAC1B,QAAQ,EAAE,MAAM,CAAC;CAClB;AAED,MAAM,WAAW,yBAAyB,CAAC,CAAC;IAC1C,IAAI,EAAE,CAAC,CAAC;IACR,OAAO,EAAE,MAAM,CAAC;IAChB,MAAM,EAAE;QACN,MAAM,EAAE,MAAM,CAAC;QACf,UAAU,EAAE,MAAM,CAAC;QACnB,KAAK,EAAE,MAAM,CAAC;KACf,CAAC;IACF,OAAO,EAAE,MAAM,CAAC;IAChB,SAAS,EAAE,MAAM,CAAC;IAClB,gBAAgB,EAAE,OAAO,CAAC;CAC3B;AAED,MAAM,WAAW,+BAA+B,CAAC,CAAC;IAChD,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,QAAQ,EAAE,WAAW,EAAE,CAAC;IACxB,MAAM,EAAE,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC;IACrB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,gBAAgB,CAAC,EAAE,eAAe,CAAC;IACnC,mBAAmB,CAAC,EAAE,OAAO,CAAC;CAC/B"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "avantgate",
3
- "version": "1.1.2",
3
+ "version": "1.2.0",
4
4
  "description": "Zero-infrastructure, in-process LLM control plane & SaaS observability bridge: real-time cost control, token budgets, PII redaction, prompt guardrails, multi-model failover, durable agent workflow harness, and HTTP telemetry without hosting heavy servers.",
5
5
  "author": "Antigravity & LexTalk Team",
6
6
  "license": "MIT",
@@ -59,12 +59,12 @@
59
59
  "LICENSE"
60
60
  ],
61
61
  "scripts": {
62
- "build": "tsup src/index.ts src/finance/index.ts src/agent/index.ts --format cjs --format esm --dts --clean",
62
+ "build": "tsup src/index.ts src/finance/index.ts src/agent/index.ts --format cjs --format esm --clean && tsc --emitDeclarationOnly --outDir dist",
63
63
  "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",
64
64
  "test:finance": "tsx tests/financial-normalizer.test.ts",
65
65
  "test:prompts": "tsx tests/prompt-builder.test.ts",
66
66
  "test:pii": "tsx tests/pii-extended.test.ts",
67
- "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",
67
+ "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",
68
68
  "lint": "tsc --noEmit",
69
69
  "prepublishOnly": "npm run build && npm test"
70
70
  },