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,50 @@
1
+ import type { StepRecord, StepStatus, StepStorageAdapter, ToolExecutionRecord } from "../types";
2
+ export interface CustomStorageHandlers {
3
+ getStep: <T = unknown>(workflowId: string, stepId: string) => Promise<StepRecord<T> | null>;
4
+ saveStep: <T = unknown>(step: StepRecord<T>) => Promise<void>;
5
+ updateStepStatus: <T = unknown>(workflowId: string, stepId: string, status: StepStatus, patch?: Partial<StepRecord<T>>) => Promise<void>;
6
+ listSteps: (workflowId: string) => Promise<StepRecord[]>;
7
+ saveToolExecution?: (record: ToolExecutionRecord) => Promise<void>;
8
+ listToolExecutions?: (workflowId?: string, stepId?: string) => Promise<ToolExecutionRecord[]>;
9
+ getCachedToolResult?: <T = unknown>(cacheKey: string) => Promise<T | null>;
10
+ setCachedToolResult?: <T = unknown>(cacheKey: string, result: T, ttlSeconds: number) => Promise<void>;
11
+ getStateValue?: <T = unknown>(key: string) => Promise<T | null>;
12
+ setStateValue?: <T = unknown>(key: string, value: T, ttlSeconds?: number) => Promise<void>;
13
+ deleteStateValue?: (key: string) => Promise<void>;
14
+ }
15
+ export interface KeyValueStoreClient {
16
+ get(key: string): Promise<string | null> | string | null;
17
+ set(key: string, value: string, ttlSeconds?: number): Promise<void | unknown> | void | unknown;
18
+ del?(key: string): Promise<void | unknown> | void | unknown;
19
+ keys?(pattern?: string): Promise<string[]> | string[];
20
+ }
21
+ export interface KeyValueAdapterOptions {
22
+ prefix?: string;
23
+ ttlSeconds?: number;
24
+ }
25
+ /**
26
+ * Universal functional builder for plugging any external storage library
27
+ * (Drizzle, Kysely, Supabase, TypeORM, Mongo, custom REST API...)
28
+ */
29
+ export declare function createCustomStorageAdapter(handlers: CustomStorageHandlers): StepStorageAdapter;
30
+ /**
31
+ * Universal Key-Value adapter enabling any KV client (Redis, Upstash, Cloudflare KV,
32
+ * Keyv, Memcached) to be plugged in with simple get/set operations.
33
+ */
34
+ export declare class KeyValueStorageAdapter implements StepStorageAdapter {
35
+ private readonly client;
36
+ private readonly prefix;
37
+ private readonly ttlSeconds?;
38
+ constructor(client: KeyValueStoreClient, options?: KeyValueAdapterOptions);
39
+ private buildKey;
40
+ getStep<T = unknown>(workflowId: string, stepId: string): Promise<StepRecord<T> | null>;
41
+ saveStep<T = unknown>(step: StepRecord<T>): Promise<void>;
42
+ updateStepStatus<T = unknown>(workflowId: string, stepId: string, status: StepStatus, patch?: Partial<StepRecord<T>>): Promise<void>;
43
+ listSteps(workflowId: string): Promise<StepRecord[]>;
44
+ getCachedToolResult<T = unknown>(cacheKey: string): Promise<T | null>;
45
+ setCachedToolResult<T = unknown>(cacheKey: string, result: T, ttlSeconds: number): Promise<void>;
46
+ getStateValue<T = unknown>(key: string): Promise<T | null>;
47
+ setStateValue<T = unknown>(key: string, value: T, ttlSeconds?: number): Promise<void>;
48
+ deleteStateValue(key: string): Promise<void>;
49
+ }
50
+ //# sourceMappingURL=custom-adapter.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"custom-adapter.d.ts","sourceRoot":"","sources":["../../../src/agent/adapters/custom-adapter.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,UAAU,EACV,UAAU,EACV,kBAAkB,EAClB,mBAAmB,EACpB,MAAM,UAAU,CAAC;AAElB,MAAM,WAAW,qBAAqB;IACpC,OAAO,EAAE,CAAC,CAAC,GAAG,OAAO,EACnB,UAAU,EAAE,MAAM,EAClB,MAAM,EAAE,MAAM,KACX,OAAO,CAAC,UAAU,CAAC,CAAC,CAAC,GAAG,IAAI,CAAC,CAAC;IACnC,QAAQ,EAAE,CAAC,CAAC,GAAG,OAAO,EAAE,IAAI,EAAE,UAAU,CAAC,CAAC,CAAC,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;IAC9D,gBAAgB,EAAE,CAAC,CAAC,GAAG,OAAO,EAC5B,UAAU,EAAE,MAAM,EAClB,MAAM,EAAE,MAAM,EACd,MAAM,EAAE,UAAU,EAClB,KAAK,CAAC,EAAE,OAAO,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC,KAC3B,OAAO,CAAC,IAAI,CAAC,CAAC;IACnB,SAAS,EAAE,CAAC,UAAU,EAAE,MAAM,KAAK,OAAO,CAAC,UAAU,EAAE,CAAC,CAAC;IAGzD,iBAAiB,CAAC,EAAE,CAAC,MAAM,EAAE,mBAAmB,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;IACnE,kBAAkB,CAAC,EAAE,CACnB,UAAU,CAAC,EAAE,MAAM,EACnB,MAAM,CAAC,EAAE,MAAM,KACZ,OAAO,CAAC,mBAAmB,EAAE,CAAC,CAAC;IACpC,mBAAmB,CAAC,EAAE,CAAC,CAAC,GAAG,OAAO,EAAE,QAAQ,EAAE,MAAM,KAAK,OAAO,C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,GAAG,OAAO,EACpC,GAAG,EAAE,MAAM,EACX,KAAK,EAAE,CAAC,EACR,UAAU,CAAC,EAAE,MAAM,GAClB,OAAO,CAAC,IAAI,CAAC;IAIH,gBAAgB,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;CAO1D"}
@@ -0,0 +1,6 @@
1
+ export * from "./memory-adapter";
2
+ export * from "./custom-adapter";
3
+ export * from "./prisma-adapter";
4
+ export * from "./sqlite-adapter";
5
+ export * from "./platform-adapter";
6
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/agent/adapters/index.ts"],"names":[],"mappings":"AAAA,cAAc,kBAAkB,CAAC;AACjC,cAAc,kBAAkB,CAAC;AACjC,cAAc,kBAAkB,CAAC;AACjC,cAAc,kBAAkB,CAAC;AACjC,cAAc,oBAAoB,CAAC"}
@@ -0,0 +1,34 @@
1
+ import type { StepRecord, StepStatus, StepStorageAdapter, ToolExecutionRecord } from "../types";
2
+ export interface MemoryAdapterOptions {
3
+ ttlMs?: number;
4
+ }
5
+ /**
6
+ * In-memory storage adapter for development, prototyping, and tests.
7
+ * Zero-infrastructure and ultra-fast with complete tool trace and cache support.
8
+ */
9
+ export declare class MemoryStorageAdapter implements StepStorageAdapter {
10
+ private readonly storage;
11
+ private readonly toolExecutions;
12
+ private readonly cacheStorage;
13
+ private readonly stateStorage;
14
+ private readonly ttlMs?;
15
+ constructor(options?: MemoryAdapterOptions);
16
+ private buildKey;
17
+ private isExpired;
18
+ getStep<T = unknown>(workflowId: string, stepId: string): Promise<StepRecord<T> | null>;
19
+ saveStep<T = unknown>(step: StepRecord<T>): Promise<void>;
20
+ updateStepStatus<T = unknown>(workflowId: string, stepId: string, status: StepStatus, patch?: Partial<StepRecord<T>>): Promise<void>;
21
+ listSteps(workflowId: string): Promise<StepRecord[]>;
22
+ saveToolExecution(record: ToolExecutionRecord): Promise<void>;
23
+ listToolExecutions(workflowId?: string, stepId?: string): Promise<ToolExecutionRecord[]>;
24
+ getCachedToolResult<T = unknown>(cacheKey: string): Promise<T | null>;
25
+ setCachedToolResult<T = unknown>(cacheKey: string, result: T, ttlSeconds: number): Promise<void>;
26
+ getStateValue<T = unknown>(key: string): Promise<T | null>;
27
+ setStateValue<T = unknown>(key: string, value: T, ttlSeconds?: number): Promise<void>;
28
+ deleteStateValue(key: string): Promise<void>;
29
+ /**
30
+ * Resets all internal in-memory maps (useful for test isolation).
31
+ */
32
+ clear(): void;
33
+ }
34
+ //# sourceMappingURL=memory-adapter.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"memory-adapter.d.ts","sourceRoot":"","sources":["../../../src/agent/adapters/memory-adapter.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,UAAU,EACV,UAAU,EACV,kBAAkB,EAClB,mBAAmB,EACpB,MAAM,UAAU,CAAC;AAElB,MAAM,WAAW,oBAAoB;IACnC,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAiBD;;;GAGG;AACH,qBAAa,oBAAqB,YAAW,kBAAkB;IAC7D,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAkC;IAC1D,OAAO,CAAC,QAAQ,CAAC,cAAc,CAA6B;IAC5D,OAAO,CAAC,QAAQ,CAAC,YAAY,CAAiC;IAC9D,OAAO,CAAC,QAAQ,CAAC,YAAY,CAAiC;IAC9D,OAAO,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAS;gBAEpB,OAAO,GAAE,oBAAyB;IAI9C,OAAO,CAAC,QAAQ;IAIhB,OAAO,CAAC,SAAS;IAOJ,OAAO,CAAC,CAAC,GAAG,OAAO,EAC9B,UAAU,EAAE,MAAM,EAClB,MAAM,EAAE,MAAM,GACb,OAAO,CAAC,UAAU,CAAC,CAAC,CAAC,GAAG,IAAI,CAAC;IAanB,QAAQ,CAAC,CAAC,GAAG,OAAO,EAAE,IAAI,EAAE,UAAU,CAAC,CAAC,CAAC,GAAG,OAAO,CAAC,IAAI,CAAC;IASzD,gBAAgB,CAAC,CAAC,GAAG,OAAO,EACvC,UAAU,EAAE,MAAM,EAClB,MAAM,EAAE,MAAM,EACd,MAAM,EAAE,UAAU,EAClB,KAAK,CAAC,EAAE,OAAO,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC,GAC7B,OAAO,CAAC,IAAI,CAAC;IAgBH,SAAS,CAAC,UAAU,EAAE,MAAM,GAAG,OAAO,CAAC,UAAU,EAAE,CAAC;IAcpD,iBAAiB,CAAC,MAAM,EAAE,mBAAmB,GAAG,OAAO,CAAC,IAAI,CAAC;IAI7D,kBAAkB,CAC7B,UAAU,CAAC,EAAE,MAAM,EACnB,MAAM,CAAC,EAAE,MAAM,GACd,OAAO,CAAC,mBAAmB,EAAE,CAAC;IAQpB,mBAAmB,CAAC,CAAC,GAAG,OAAO,EAAE,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,CAAC,GAAG,IAAI,CAAC;IAYrE,mBAAmB,CAAC,CAAC,GAAG,OAAO,EAC1C,QAAQ,EAAE,MAAM,EAChB,MAAM,EAAE,CAAC,EACT,UAAU,EAAE,MAAM,GACjB,OAAO,CAAC,IAAI,CAAC;IAKH,aAAa,CAAC,CAAC,GAAG,OAAO,EAAE,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,CAAC,GAAG,IAAI,CAAC;IAY1D,aAAa,CAAC,CAAC,GAAG,OAAO,EACpC,GAAG,EAAE,MAAM,EACX,KAAK,EAAE,CAAC,EACR,UAAU,CAAC,EAAE,MAAM,GAClB,OAAO,CAAC,IAAI,CAAC;IAKH,gBAAgB,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IAIzD;;OAEG;IACI,KAAK,IAAI,IAAI;CAMrB"}
@@ -0,0 +1,32 @@
1
+ import type { StepRecord, StepStatus, StepStorageAdapter, ToolExecutionRecord } from "../types";
2
+ import type { HttpTelemetryExporter } from "../telemetry/http-exporter";
3
+ export interface PlatformStorageAdapterConfig {
4
+ exporter: HttpTelemetryExporter;
5
+ primaryStorage?: StepStorageAdapter;
6
+ }
7
+ /**
8
+ * Hexagonal Hybrid Storage Adapter: persists steps and tool executions locally
9
+ * while mirroring telemetry events asynchronously to avantGate Cloud.
10
+ */
11
+ export declare class PlatformStorageAdapter implements StepStorageAdapter {
12
+ private readonly exporter;
13
+ private readonly primary;
14
+ constructor(config: PlatformStorageAdapterConfig);
15
+ getStep<T = unknown>(workflowId: string, stepId: string): Promise<StepRecord<T> | null>;
16
+ saveStep<T = unknown>(record: StepRecord<T>): Promise<void>;
17
+ updateStepStatus(workflowId: string, stepId: string, status: StepStatus, updates?: {
18
+ result?: unknown;
19
+ error?: string;
20
+ metadata?: Record<string, unknown>;
21
+ }): Promise<void>;
22
+ listSteps(workflowId: string): Promise<StepRecord[]>;
23
+ saveToolExecution(record: ToolExecutionRecord): Promise<void>;
24
+ listToolExecutions(workflowId?: string, stepId?: string): Promise<ToolExecutionRecord[]>;
25
+ getCachedToolResult<T = unknown>(cacheKey: string): Promise<T | null>;
26
+ setCachedToolResult<T = unknown>(cacheKey: string, result: T, ttlSeconds: number): Promise<void>;
27
+ getStateValue<T = unknown>(key: string): Promise<T | null>;
28
+ setStateValue<T = unknown>(key: string, value: T, ttlSeconds?: number): Promise<void>;
29
+ deleteStateValue(key: string): Promise<void>;
30
+ clearStateValues(): Promise<void>;
31
+ }
32
+ //# sourceMappingURL=platform-adapter.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"platform-adapter.d.ts","sourceRoot":"","sources":["../../../src/agent/adapters/platform-adapter.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,UAAU,EACV,UAAU,EACV,kBAAkB,EAClB,mBAAmB,EACpB,MAAM,UAAU,CAAC;AAElB,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,4BAA4B,CAAC;AAUxE,MAAM,WAAW,4BAA4B;IAC3C,QAAQ,EAAE,qBAAqB,CAAC;IAChC,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jB,OAAO,CAAC,IAAI,CAAC;IAMH,aAAa,CAAC,CAAC,GAAG,OAAO,EAAE,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,CAAC,GAAG,IAAI,CAAC;IAO1D,aAAa,CAAC,CAAC,GAAG,OAAO,EACpC,GAAG,EAAE,MAAM,EACX,KAAK,EAAE,CAAC,EACR,UAAU,CAAC,EAAE,MAAM,GAClB,OAAO,CAAC,IAAI,CAAC;IAMH,gBAAgB,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IAM5C,gBAAgB,IAAI,OAAO,CAAC,IAAI,CAAC;CAK/C"}
@@ -0,0 +1,55 @@
1
+ import type { StepRecord, StepStatus, StepStorageAdapter, ToolExecutionRecord } from "../types";
2
+ export interface PrismaStepModelDelegate {
3
+ findUnique(args: {
4
+ where: {
5
+ workflowId_stepId: {
6
+ workflowId: string;
7
+ stepId: string;
8
+ };
9
+ };
10
+ }): Promise<any>;
11
+ upsert(args: {
12
+ where: {
13
+ workflowId_stepId: {
14
+ workflowId: string;
15
+ stepId: string;
16
+ };
17
+ };
18
+ create: any;
19
+ update: any;
20
+ }): Promise<any>;
21
+ findMany(args: {
22
+ where: {
23
+ workflowId: string;
24
+ };
25
+ orderBy?: any;
26
+ }): Promise<any[]>;
27
+ }
28
+ export interface PrismaToolDelegates {
29
+ toolExecution?: any;
30
+ toolCache?: any;
31
+ sharedState?: any;
32
+ }
33
+ /**
34
+ * Storage adapter integrating with Prisma ORM without imposing a direct dependency.
35
+ */
36
+ export declare class PrismaStorageAdapter implements StepStorageAdapter {
37
+ private readonly model;
38
+ private readonly toolDelegates?;
39
+ private readonly volatileCache;
40
+ private readonly volatileState;
41
+ private readonly volatileExecutions;
42
+ constructor(model: PrismaStepModelDelegate, toolDelegates?: PrismaToolDelegates);
43
+ getStep<T = unknown>(workflowId: string, stepId: string): Promise<StepRecord<T> | null>;
44
+ saveStep<T = unknown>(step: StepRecord<T>): Promise<void>;
45
+ updateStepStatus<T = unknown>(workflowId: string, stepId: string, status: StepStatus, patch?: Partial<StepRecord<T>>): Promise<void>;
46
+ listSteps(workflowId: string): Promise<StepRecord[]>;
47
+ saveToolExecution(record: ToolExecutionRecord): Promise<void>;
48
+ listToolExecutions(workflowId?: string, stepId?: string): Promise<ToolExecutionRecord[]>;
49
+ getCachedToolResult<T = unknown>(cacheKey: string): Promise<T | null>;
50
+ setCachedToolResult<T = unknown>(cacheKey: string, result: T, ttlSeconds: number): Promise<void>;
51
+ getStateValue<T = unknown>(key: string): Promise<T | null>;
52
+ setStateValue<T = unknown>(key: string, value: T, ttlSeconds?: number): Promise<void>;
53
+ deleteStateValue(key: string): Promise<void>;
54
+ }
55
+ //# sourceMappingURL=prisma-adapter.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"prisma-adapter.d.ts","sourceRoot":"","sources":["../../../src/agent/adapters/prisma-adapter.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,UAAU,EACV,UAAU,EACV,kBAAkB,EAClB,mBAAmB,EACpB,MAAM,UAAU,CAAC;AAElB,MAAM,WAAW,uBAAuB;IACtC,UAAU,CAAC,IAAI,EAAE;QACf,KAAK,EAAE;YACL,iBAAiB,EAAE;gBAAE,UAAU,EAAE,MAAM,CAAC;gBAAC,MAAM,EAAE,MAAM,CAAA;aAAE,CAAC;SAC3D,CAAC;KACH,GAAG,OAAO,CAAC,GAAG,CAAC,CAAC;IACjB,MAAM,CAAC,IAAI,EAAE;QACX,KAAK,EAAE;YACL,iBAAiB,EAAE;gBAAE,UAAU,EAAE,MAAM,CAAC;gBAAC,MAAM,EAAE,MAAM,CAAA;aAAE,CAAC;SAC3D,CAAC;QACF,MAAM,EAAE,GAAG,CAAC;QACZ,MAAM,EAAE,GAAG,CAAC;KACb,GAAG,OAAO,CAAC,GAAG,CAAC,CAAC;IACjB,QAAQ,CAAC,IAAI,EAAE;QACb,KAAK,EAAE;YAAE,UAAU,EAAE,MAAM,CAAA;SAAE,CAAC;Q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,EACnB,MAAM,CAAC,EAAE,MAAM,GACd,OAAO,CAAC,mBAAmB,EAAE,CAAC;IAuBpB,mBAAmB,CAAC,CAAC,GAAG,OAAO,EAAE,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,CAAC,GAAG,IAAI,CAAC;IAarE,mBAAmB,CAAC,CAAC,GAAG,OAAO,EAC1C,QAAQ,EAAE,MAAM,EAChB,MAAM,EAAE,CAAC,EACT,UAAU,EAAE,MAAM,GACjB,OAAO,CAAC,IAAI,CAAC;IAaH,aAAa,CAAC,CAAC,GAAG,OAAO,EAAE,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,CAAC,GAAG,IAAI,CAAC;IAa1D,aAAa,CAAC,CAAC,GAAG,OAAO,EACpC,GAAG,EAAE,MAAM,EACX,KAAK,EAAE,CAAC,EACR,UAAU,CAAC,EAAE,MAAM,GAClB,OAAO,CAAC,IAAI,CAAC;IAaH,gBAAgB,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;CAS1D"}
@@ -0,0 +1,31 @@
1
+ import type { StepRecord, StepStatus, StepStorageAdapter, ToolExecutionRecord } from "../types";
2
+ export interface SQLiteStatementLike {
3
+ get(...params: any[]): any;
4
+ all(...params: any[]): any[];
5
+ run(...params: any[]): any;
6
+ }
7
+ export interface SQLiteDatabaseLike {
8
+ exec(sql: string): void;
9
+ prepare(sql: string): SQLiteStatementLike;
10
+ }
11
+ /**
12
+ * SQLite storage adapter for local edge execution and serverless durable workflows.
13
+ * Automatically initializes tables for steps, tool executions, cache and blackboard state.
14
+ */
15
+ export declare class SQLiteStorageAdapter implements StepStorageAdapter {
16
+ private readonly db;
17
+ constructor(db: SQLiteDatabaseLike);
18
+ private initTables;
19
+ getStep<T = unknown>(workflowId: string, stepId: string): Promise<StepRecord<T> | null>;
20
+ saveStep<T = unknown>(step: StepRecord<T>): Promise<void>;
21
+ updateStepStatus<T = unknown>(workflowId: string, stepId: string, status: StepStatus, patch?: Partial<StepRecord<T>>): Promise<void>;
22
+ listSteps(workflowId: string): Promise<StepRecord[]>;
23
+ saveToolExecution(record: ToolExecutionRecord): Promise<void>;
24
+ listToolExecutions(workflowId?: string, stepId?: string): Promise<ToolExecutionRecord[]>;
25
+ getCachedToolResult<T = unknown>(cacheKey: string): Promise<T | null>;
26
+ setCachedToolResult<T = unknown>(cacheKey: string, result: T, ttlSeconds: number): Promise<void>;
27
+ getStateValue<T = unknown>(key: string): Promise<T | null>;
28
+ setStateValue<T = unknown>(key: string, value: T, ttlSeconds?: number): Promise<void>;
29
+ deleteStateValue(key: string): Promise<void>;
30
+ }
31
+ //# sourceMappingURL=sqlite-adapter.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"sqlite-adapter.d.ts","sourceRoot":"","sources":["../../../src/agent/adapters/sqlite-adapter.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,UAAU,EACV,UAAU,EACV,kBAAkB,EAClB,mBAAmB,EACpB,MAAM,UAAU,CAAC;AAElB,MAAM,WAAW,mBAAmB;IAClC,GAAG,CAAC,GAAG,MAAM,EAAE,GAAG,EAAE,GAAG,GAAG,CAAC;IAC3B,GAAG,CAAC,GAAG,MAAM,EAAE,GAAG,EAAE,GAAG,GAAG,EAAE,CAAC;IAC7B,GAAG,CAAC,GAAG,MAAM,EAAE,GAAG,EAAE,GAAG,GAAG,CAAC;CAC5B;AAED,MAAM,WAAW,kBAAkB;IACjC,IAAI,CAAC,GAAG,EAAE,MAAM,GAAG,IAAI,CAAC;IACxB,OAAO,CAAC,GAAG,EAAE,MAAM,GAAG,mBAAmB,CAAC;CAC3C;AAsED;;;GAGG;AACH,qBAAa,oBAAqB,YAAW,kBAAkB;IAC7D,OAAO,CAAC,QAAQ,CAAC,EAAE,CAAqB;gBAE5B,EAAE,EAAE,kBAAkB;IAKlC,OAAO,CAAC,UAAU;IA8CL,OAAO,CAAC,CAAC,GAAG,OAAO,EAC9B,UAAU,EAAE,MAAM,EAClB,MAAM,EAAE,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 +1,32 @@
1
+ /**
2
+ * Declarative DTO Projection Helpers for avantgate/agent.
3
+ * Standardizes common tool output projections (booleans, count, field pick)
4
+ * to minimize LLM token consumption and prevent PII leakage.
5
+ */
6
+ export interface DtoBooleanResult {
7
+ success: boolean;
8
+ }
9
+ export interface DtoCountResult {
10
+ success: true;
11
+ count: number;
12
+ }
13
+ export declare const dto: {
14
+ /**
15
+ * Generates a boolean acknowledgment for mutations ({ success: true | false }).
16
+ * If rawResult contains a boolean `success` property, it is preserved; otherwise defaults to true.
17
+ */
18
+ boolean: () => (data: any) => DtoBooleanResult;
19
+ /**
20
+ * Generates a boolean acknowledgment preserving an opaque technical identifier for tool chaining.
21
+ */
22
+ booleanWithId: <K extends string = "id">(idKey?: K) => (data: any) => DtoBooleanResult & Record<K, unknown>;
23
+ /**
24
+ * Extracts a numeric count from a list or nested array property without exposing items to the LLM.
25
+ */
26
+ count: (arrayKey?: string) => (data: any) => DtoCountResult;
27
+ /**
28
+ * Filters raw output by extracting only a strict whitelist of allowed fields.
29
+ */
30
+ pick: <T extends string>(keys: readonly T[] | T[]) => (data: any) => Record<T, unknown>;
31
+ };
32
+ //# sourceMappingURL=dto.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"dto.d.ts","sourceRoot":"","sources":["../../src/agent/dto.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,MAAM,WAAW,gBAAgB;IAC/B,OAAO,EAAE,OAAO,CAAC;CAClB;AAED,MAAM,WAAW,cAAc;IAC7B,OAAO,EAAE,IAAI,CAAC;IACd,KAAK,EAAE,MAAM,CAAC;CACf;AAED,eAAO,MAAM,GAAG;IACd;;;OAGG;oBACa,MAAM,GAAG,KAAG,gBAAgB;IAI5C;;OAEG;oBACa,CAAC,SAAS,MAAM,iBAAgB,CAAC,MAC9C,MAAM,GAAG,KAAG,gBAAgB,GAAG,MAAM,CAAC,CAAC,EAAE,OAAO,CAAC;IAMpD;;OAEG;uBAEW,MAAM,MACjB,MAAM,GAAG,KAAG,cAAc;IAQ7B;;OAEG;WAEA,CAAC,SAAS,MAAM,QAAQ,SAAS,CAAC,EAAE,GAAG,CAAC,EAAE,MAC1C,MAAM,GAAG,KAAG,MAAM,CAAC,CAAC,EAAE,OAAO,CAAC;CAYlC,CAAC"}
@@ -0,0 +1,50 @@
1
+ /**
2
+ * Domain and operational errors for avantgate/agent.
3
+ */
4
+ export declare class StepSuspendedError extends Error {
5
+ readonly stepId: string;
6
+ readonly workflowId: string;
7
+ readonly metadata?: Record<string, unknown>;
8
+ constructor(stepId: string, workflowId: string, metadata?: Record<string, unknown>);
9
+ }
10
+ export declare class PiiLeakError extends Error {
11
+ readonly toolName: string;
12
+ readonly maskedCount: number;
13
+ constructor(toolName: string, maskedCount: number);
14
+ }
15
+ export declare class StepExecutionError extends Error {
16
+ readonly stepId: string;
17
+ readonly workflowId: string;
18
+ readonly originalError?: unknown;
19
+ constructor(stepId: string, workflowId: string, message: string, originalError?: unknown);
20
+ }
21
+ export declare class ToolAccessDeniedError extends Error {
22
+ readonly toolName: string;
23
+ readonly requiredRole?: string;
24
+ readonly reason?: string;
25
+ constructor(toolName: string, reasonOrRole?: string);
26
+ }
27
+ export declare class CircularToolCallError extends Error {
28
+ readonly cycle: string[];
29
+ constructor(cycle: string[]);
30
+ }
31
+ export declare class ToolCallDepthExceededError extends Error {
32
+ readonly depth: number;
33
+ readonly maxDepth: number;
34
+ constructor(depth: number, maxDepth: number);
35
+ }
36
+ export declare class ToolSubCallQuotaError extends Error {
37
+ readonly totalCalls: number;
38
+ readonly maxCalls: number;
39
+ constructor(totalCalls: number, maxCalls: number);
40
+ }
41
+ export declare class ToolNotFoundError extends Error {
42
+ readonly toolId: string;
43
+ constructor(toolId: string);
44
+ }
45
+ export declare class DtoValidationError extends Error {
46
+ readonly toolName: string;
47
+ readonly issues: unknown[];
48
+ constructor(toolName: string, message: string, issues?: unknown[]);
49
+ }
50
+ //# sourceMappingURL=errors.d.ts.map
@@ -0,0 +1 @@
1
+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C9B,SAAgB,QAAQ,EAAE,MAAM,CAAC;gBAErB,KAAK,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM;CAM5C;AAED,qBAAa,qBAAsB,SAAQ,KAAK;IAC9C,SAAgB,UAAU,EAAE,MAAM,CAAC;IACnC,SAAgB,QAAQ,EAAE,MAAM,CAAC;gBAErB,UAAU,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM;CAMjD;AAED,qBAAa,iBAAkB,SAAQ,KAAK;IAC1C,SAAgB,MAAM,EAAE,MAAM,CAAC;gBAEnB,MAAM,EAAE,MAAM;CAK3B;AAED,qBAAa,kBAAmB,SAAQ,KAAK;IAC3C,SAAgB,QAAQ,EAAE,MAAM,CAAC;IACjC,SAAgB,MAAM,EAAE,OAAO,EAAE,CAAC;gBAEtB,QAAQ,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,MAAM,GAAE,OAAO,EAAO;CAMtE"}
@@ -0,0 +1,21 @@
1
+ import type { IsolatedToolConfig, ToolContext, VercelAiCoreTool } from "./types";
2
+ /**
3
+ * Factory for creating isolated tools with injected context and dependencies.
4
+ */
5
+ export declare class AgentToolFactory {
6
+ private readonly context;
7
+ constructor(defaultContext?: ToolContext);
8
+ /**
9
+ * Returns a new factory instance with merged context.
10
+ */
11
+ withContext(extraContext: ToolContext): AgentToolFactory;
12
+ /**
13
+ * Returns current factory context.
14
+ */
15
+ getContext(): ToolContext;
16
+ /**
17
+ * Instantiates an isolated tool by injecting factory context into the builder function.
18
+ */
19
+ createTool<TArgs = any, TResult = any>(builder: (context: ToolContext) => IsolatedToolConfig<TArgs, TResult>): VercelAiCoreTool<TArgs, TResult>;
20
+ }
21
+ //# sourceMappingURL=factory.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"factory.d.ts","sourceRoot":"","sources":["../../src/agent/factory.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EACV,kBAAkB,EAClB,WAAW,EACX,gBAAgB,EACjB,MAAM,SAAS,CAAC;AAEjB;;GAEG;AACH,qBAAa,gBAAgB;IAC3B,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAc;gBAE1B,cAAc,GAAE,WAAgB;IAI5C;;OAEG;IACI,WAAW,CAAC,YAAY,EAAE,WAAW,GAAG,gBAAgB;IAO/D;;OAEG;IACI,UAAU,IAAI,WAAW;IAIhC;;OAEG;IACI,UAAU,CAAC,KAAK,GAAG,GAAG,EAAE,OAAO,GAAG,GAAG,EAC1C,OAAO,EAAE,CAAC,OAAO,EAAE,WAAW,KAAK,kBAAkB,CAAC,KAAK,EAAE,OAAO,CAAC,GACpE,gBAAgB,CAAC,KAAK,EAAE,OAAO,CAAC;CAIpC"}
@@ -0,0 +1,14 @@
1
+ export interface AuditToolResultOutput {
2
+ sanitizedData: unknown;
3
+ maskedCount: number;
4
+ }
5
+ export interface AuditToolResultOptions {
6
+ toolName: string;
7
+ throwOnPii?: boolean;
8
+ }
9
+ /**
10
+ * Audits and sanitizes data returned by tools before sending it to the LLM.
11
+ * Throws PiiLeakError if throwOnPii is enabled and PII is detected.
12
+ */
13
+ export declare function auditToolResult(data: unknown, options: AuditToolResultOptions): AuditToolResultOutput;
14
+ //# sourceMappingURL=guardrails.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"guardrails.d.ts","sourceRoot":"","sources":["../../src/agent/guardrails.ts"],"names":[],"mappings":"AAGA,MAAM,WAAW,qBAAqB;IACpC,aAAa,EAAE,OAAO,CAAC;IACvB,WAAW,EAAE,MAAM,CAAC;CACrB;AAED,MAAM,WAAW,sBAAsB;IACrC,QAAQ,EAAE,MAAM,CAAC;IACjB,UAAU,CAAC,EAAE,OAAO,CAAC;CACtB;AA8DD;;;GAGG;AACH,wBAAgB,eAAe,CAC7B,IAAI,EAAE,OAAO,EACb,OAAO,EAAE,sBAAsB,GAC9B,qBAAqB,CAWvB"}