@digilogiclabs/platform-core 1.20.3 → 1.23.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/{ConsoleEmail-CO0OM4UT.d.ts → ConsoleEmail-CgSIvRdj.d.mts} +5 -46
- package/dist/{ConsoleEmail-DDB28vyS.d.mts → ConsoleEmail-iJO7Cb_v.d.ts} +5 -46
- package/dist/{IAI-D8wA_i8N.d.mts → IAI-B7pp322X.d.mts} +1 -170
- package/dist/{IAI-D8wA_i8N.d.ts → IAI-B7pp322X.d.ts} +1 -170
- package/dist/ICache-BWSuTuhz.d.mts +66 -0
- package/dist/ICache-BWSuTuhz.d.ts +66 -0
- package/dist/IEmail-CsOcaQcb.d.mts +45 -0
- package/dist/IEmail-CsOcaQcb.d.ts +45 -0
- package/dist/ILogger-DLDBZaH4.d.mts +105 -0
- package/dist/ILogger-DLDBZaH4.d.ts +105 -0
- package/dist/{agents-DGciJI27.d.mts → agents-C7FPA8y9.d.mts} +3 -1
- package/dist/{agents-Cc65YUoW.d.ts → agents-qyQ3BtXy.d.ts} +3 -1
- package/dist/agents.d.mts +4 -2
- package/dist/agents.d.ts +4 -2
- package/dist/auth.d.mts +386 -1
- package/dist/auth.d.ts +386 -1
- package/dist/auth.js +451 -0
- package/dist/auth.js.map +1 -1
- package/dist/auth.mjs +434 -0
- package/dist/auth.mjs.map +1 -1
- package/dist/circuit-breaker-CP6kw0P5.d.ts +351 -0
- package/dist/circuit-breaker-CsQivd57.d.mts +351 -0
- package/dist/email-templates.d.mts +106 -1
- package/dist/email-templates.d.ts +106 -1
- package/dist/email-templates.js +608 -0
- package/dist/email-templates.js.map +1 -1
- package/dist/email-templates.mjs +596 -0
- package/dist/email-templates.mjs.map +1 -1
- package/dist/index.d.mts +14 -355
- package/dist/index.d.ts +14 -355
- package/dist/index.js +10 -7
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +10 -7
- package/dist/index.mjs.map +1 -1
- package/dist/migrate.js +0 -0
- package/dist/testing.d.mts +6 -3
- package/dist/testing.d.ts +6 -3
- package/package.json +11 -11
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Email abstraction interface
|
|
3
|
+
* Provides a vendor-agnostic way to send emails
|
|
4
|
+
*/
|
|
5
|
+
interface EmailAddress {
|
|
6
|
+
email: string;
|
|
7
|
+
name?: string;
|
|
8
|
+
}
|
|
9
|
+
interface EmailAttachment {
|
|
10
|
+
filename: string;
|
|
11
|
+
content: Buffer | string;
|
|
12
|
+
contentType?: string;
|
|
13
|
+
}
|
|
14
|
+
interface EmailMessage {
|
|
15
|
+
to: EmailAddress | EmailAddress[];
|
|
16
|
+
from?: EmailAddress;
|
|
17
|
+
replyTo?: EmailAddress;
|
|
18
|
+
subject: string;
|
|
19
|
+
text?: string;
|
|
20
|
+
html?: string;
|
|
21
|
+
attachments?: EmailAttachment[];
|
|
22
|
+
headers?: Record<string, string>;
|
|
23
|
+
tags?: string[];
|
|
24
|
+
}
|
|
25
|
+
interface EmailResult {
|
|
26
|
+
id: string;
|
|
27
|
+
success: boolean;
|
|
28
|
+
error?: Error;
|
|
29
|
+
}
|
|
30
|
+
interface IEmail {
|
|
31
|
+
/**
|
|
32
|
+
* Send an email
|
|
33
|
+
*/
|
|
34
|
+
send(message: EmailMessage): Promise<EmailResult>;
|
|
35
|
+
/**
|
|
36
|
+
* Send multiple emails (batch)
|
|
37
|
+
*/
|
|
38
|
+
sendBatch(messages: EmailMessage[]): Promise<EmailResult[]>;
|
|
39
|
+
/**
|
|
40
|
+
* Check email service connectivity
|
|
41
|
+
*/
|
|
42
|
+
healthCheck(): Promise<boolean>;
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
export type { EmailMessage as E, IEmail as I, EmailResult as a, EmailAddress as b, EmailAttachment as c };
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Email abstraction interface
|
|
3
|
+
* Provides a vendor-agnostic way to send emails
|
|
4
|
+
*/
|
|
5
|
+
interface EmailAddress {
|
|
6
|
+
email: string;
|
|
7
|
+
name?: string;
|
|
8
|
+
}
|
|
9
|
+
interface EmailAttachment {
|
|
10
|
+
filename: string;
|
|
11
|
+
content: Buffer | string;
|
|
12
|
+
contentType?: string;
|
|
13
|
+
}
|
|
14
|
+
interface EmailMessage {
|
|
15
|
+
to: EmailAddress | EmailAddress[];
|
|
16
|
+
from?: EmailAddress;
|
|
17
|
+
replyTo?: EmailAddress;
|
|
18
|
+
subject: string;
|
|
19
|
+
text?: string;
|
|
20
|
+
html?: string;
|
|
21
|
+
attachments?: EmailAttachment[];
|
|
22
|
+
headers?: Record<string, string>;
|
|
23
|
+
tags?: string[];
|
|
24
|
+
}
|
|
25
|
+
interface EmailResult {
|
|
26
|
+
id: string;
|
|
27
|
+
success: boolean;
|
|
28
|
+
error?: Error;
|
|
29
|
+
}
|
|
30
|
+
interface IEmail {
|
|
31
|
+
/**
|
|
32
|
+
* Send an email
|
|
33
|
+
*/
|
|
34
|
+
send(message: EmailMessage): Promise<EmailResult>;
|
|
35
|
+
/**
|
|
36
|
+
* Send multiple emails (batch)
|
|
37
|
+
*/
|
|
38
|
+
sendBatch(messages: EmailMessage[]): Promise<EmailResult[]>;
|
|
39
|
+
/**
|
|
40
|
+
* Check email service connectivity
|
|
41
|
+
*/
|
|
42
|
+
healthCheck(): Promise<boolean>;
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
export type { EmailMessage as E, IEmail as I, EmailResult as a, EmailAddress as b, EmailAttachment as c };
|
|
@@ -0,0 +1,105 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Logger Interface
|
|
3
|
+
* Standardizes logging across the platform
|
|
4
|
+
*/
|
|
5
|
+
/**
|
|
6
|
+
* Log levels in order of severity
|
|
7
|
+
*/
|
|
8
|
+
type LogLevel = "debug" | "info" | "warn" | "error";
|
|
9
|
+
/**
|
|
10
|
+
* Metadata that can be attached to log entries
|
|
11
|
+
*/
|
|
12
|
+
interface LogMeta {
|
|
13
|
+
/** Error object if logging an error */
|
|
14
|
+
error?: Error;
|
|
15
|
+
/** Duration in milliseconds (for timing operations) */
|
|
16
|
+
duration?: number;
|
|
17
|
+
/** Request ID for tracing */
|
|
18
|
+
requestId?: string;
|
|
19
|
+
/** User ID if applicable */
|
|
20
|
+
userId?: string;
|
|
21
|
+
/** Any additional key-value pairs */
|
|
22
|
+
[key: string]: unknown;
|
|
23
|
+
}
|
|
24
|
+
/**
|
|
25
|
+
* A structured log entry
|
|
26
|
+
*/
|
|
27
|
+
interface LogEntry {
|
|
28
|
+
/** Log level */
|
|
29
|
+
level: LogLevel;
|
|
30
|
+
/** Log message */
|
|
31
|
+
message: string;
|
|
32
|
+
/** When the log was created */
|
|
33
|
+
timestamp: Date;
|
|
34
|
+
/** Optional metadata */
|
|
35
|
+
meta?: LogMeta;
|
|
36
|
+
/** Logger context (e.g., service name) */
|
|
37
|
+
context?: Record<string, unknown>;
|
|
38
|
+
}
|
|
39
|
+
/**
|
|
40
|
+
* Logger interface for structured logging
|
|
41
|
+
*/
|
|
42
|
+
interface ILogger {
|
|
43
|
+
/**
|
|
44
|
+
* Log a debug message (for development/troubleshooting)
|
|
45
|
+
*/
|
|
46
|
+
debug(message: string, meta?: LogMeta): void;
|
|
47
|
+
/**
|
|
48
|
+
* Log an informational message
|
|
49
|
+
*/
|
|
50
|
+
info(message: string, meta?: LogMeta): void;
|
|
51
|
+
/**
|
|
52
|
+
* Log a warning message
|
|
53
|
+
*/
|
|
54
|
+
warn(message: string, meta?: LogMeta): void;
|
|
55
|
+
/**
|
|
56
|
+
* Log an error message
|
|
57
|
+
*/
|
|
58
|
+
error(message: string, meta?: LogMeta): void;
|
|
59
|
+
/**
|
|
60
|
+
* Create a child logger with additional context
|
|
61
|
+
* @param context Additional context to include in all logs from this child
|
|
62
|
+
*/
|
|
63
|
+
child(context: Record<string, unknown>): ILogger;
|
|
64
|
+
}
|
|
65
|
+
/**
|
|
66
|
+
* Configuration options for loggers
|
|
67
|
+
*/
|
|
68
|
+
interface LoggerConfig {
|
|
69
|
+
/** Minimum level to log */
|
|
70
|
+
level?: LogLevel;
|
|
71
|
+
/** Whether to pretty print (for development) */
|
|
72
|
+
pretty?: boolean;
|
|
73
|
+
/** Service name to include in logs */
|
|
74
|
+
service?: string;
|
|
75
|
+
/** Environment name */
|
|
76
|
+
environment?: string;
|
|
77
|
+
}
|
|
78
|
+
/**
|
|
79
|
+
* Console logger implementation (for development)
|
|
80
|
+
*/
|
|
81
|
+
declare class ConsoleLogger implements ILogger {
|
|
82
|
+
private context;
|
|
83
|
+
private level;
|
|
84
|
+
private static levelPriority;
|
|
85
|
+
constructor(config?: LoggerConfig);
|
|
86
|
+
private shouldLog;
|
|
87
|
+
private log;
|
|
88
|
+
debug(message: string, meta?: LogMeta): void;
|
|
89
|
+
info(message: string, meta?: LogMeta): void;
|
|
90
|
+
warn(message: string, meta?: LogMeta): void;
|
|
91
|
+
error(message: string, meta?: LogMeta): void;
|
|
92
|
+
child(context: Record<string, unknown>): ILogger;
|
|
93
|
+
}
|
|
94
|
+
/**
|
|
95
|
+
* No-op logger for testing or when logging is disabled
|
|
96
|
+
*/
|
|
97
|
+
declare class NoopLogger implements ILogger {
|
|
98
|
+
debug(): void;
|
|
99
|
+
info(): void;
|
|
100
|
+
warn(): void;
|
|
101
|
+
error(): void;
|
|
102
|
+
child(): ILogger;
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
export { ConsoleLogger as C, type ILogger as I, type LogLevel as L, NoopLogger as N, type LogMeta as a, type LogEntry as b, type LoggerConfig as c };
|
|
@@ -0,0 +1,105 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Logger Interface
|
|
3
|
+
* Standardizes logging across the platform
|
|
4
|
+
*/
|
|
5
|
+
/**
|
|
6
|
+
* Log levels in order of severity
|
|
7
|
+
*/
|
|
8
|
+
type LogLevel = "debug" | "info" | "warn" | "error";
|
|
9
|
+
/**
|
|
10
|
+
* Metadata that can be attached to log entries
|
|
11
|
+
*/
|
|
12
|
+
interface LogMeta {
|
|
13
|
+
/** Error object if logging an error */
|
|
14
|
+
error?: Error;
|
|
15
|
+
/** Duration in milliseconds (for timing operations) */
|
|
16
|
+
duration?: number;
|
|
17
|
+
/** Request ID for tracing */
|
|
18
|
+
requestId?: string;
|
|
19
|
+
/** User ID if applicable */
|
|
20
|
+
userId?: string;
|
|
21
|
+
/** Any additional key-value pairs */
|
|
22
|
+
[key: string]: unknown;
|
|
23
|
+
}
|
|
24
|
+
/**
|
|
25
|
+
* A structured log entry
|
|
26
|
+
*/
|
|
27
|
+
interface LogEntry {
|
|
28
|
+
/** Log level */
|
|
29
|
+
level: LogLevel;
|
|
30
|
+
/** Log message */
|
|
31
|
+
message: string;
|
|
32
|
+
/** When the log was created */
|
|
33
|
+
timestamp: Date;
|
|
34
|
+
/** Optional metadata */
|
|
35
|
+
meta?: LogMeta;
|
|
36
|
+
/** Logger context (e.g., service name) */
|
|
37
|
+
context?: Record<string, unknown>;
|
|
38
|
+
}
|
|
39
|
+
/**
|
|
40
|
+
* Logger interface for structured logging
|
|
41
|
+
*/
|
|
42
|
+
interface ILogger {
|
|
43
|
+
/**
|
|
44
|
+
* Log a debug message (for development/troubleshooting)
|
|
45
|
+
*/
|
|
46
|
+
debug(message: string, meta?: LogMeta): void;
|
|
47
|
+
/**
|
|
48
|
+
* Log an informational message
|
|
49
|
+
*/
|
|
50
|
+
info(message: string, meta?: LogMeta): void;
|
|
51
|
+
/**
|
|
52
|
+
* Log a warning message
|
|
53
|
+
*/
|
|
54
|
+
warn(message: string, meta?: LogMeta): void;
|
|
55
|
+
/**
|
|
56
|
+
* Log an error message
|
|
57
|
+
*/
|
|
58
|
+
error(message: string, meta?: LogMeta): void;
|
|
59
|
+
/**
|
|
60
|
+
* Create a child logger with additional context
|
|
61
|
+
* @param context Additional context to include in all logs from this child
|
|
62
|
+
*/
|
|
63
|
+
child(context: Record<string, unknown>): ILogger;
|
|
64
|
+
}
|
|
65
|
+
/**
|
|
66
|
+
* Configuration options for loggers
|
|
67
|
+
*/
|
|
68
|
+
interface LoggerConfig {
|
|
69
|
+
/** Minimum level to log */
|
|
70
|
+
level?: LogLevel;
|
|
71
|
+
/** Whether to pretty print (for development) */
|
|
72
|
+
pretty?: boolean;
|
|
73
|
+
/** Service name to include in logs */
|
|
74
|
+
service?: string;
|
|
75
|
+
/** Environment name */
|
|
76
|
+
environment?: string;
|
|
77
|
+
}
|
|
78
|
+
/**
|
|
79
|
+
* Console logger implementation (for development)
|
|
80
|
+
*/
|
|
81
|
+
declare class ConsoleLogger implements ILogger {
|
|
82
|
+
private context;
|
|
83
|
+
private level;
|
|
84
|
+
private static levelPriority;
|
|
85
|
+
constructor(config?: LoggerConfig);
|
|
86
|
+
private shouldLog;
|
|
87
|
+
private log;
|
|
88
|
+
debug(message: string, meta?: LogMeta): void;
|
|
89
|
+
info(message: string, meta?: LogMeta): void;
|
|
90
|
+
warn(message: string, meta?: LogMeta): void;
|
|
91
|
+
error(message: string, meta?: LogMeta): void;
|
|
92
|
+
child(context: Record<string, unknown>): ILogger;
|
|
93
|
+
}
|
|
94
|
+
/**
|
|
95
|
+
* No-op logger for testing or when logging is disabled
|
|
96
|
+
*/
|
|
97
|
+
declare class NoopLogger implements ILogger {
|
|
98
|
+
debug(): void;
|
|
99
|
+
info(): void;
|
|
100
|
+
warn(): void;
|
|
101
|
+
error(): void;
|
|
102
|
+
child(): ILogger;
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
export { ConsoleLogger as C, type ILogger as I, type LogLevel as L, NoopLogger as N, type LogMeta as a, type LogEntry as b, type LoggerConfig as c };
|
|
@@ -1,4 +1,6 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { r as AIToolCall, s as AITool, c as AIChatResponse, q as AIMessage, a as IAI, b as AIChatRequest, I as ITracing, B as ISpan, v as AIUsageInfo, d as AIStreamChunk, e as AIStreamCallback, f as AICompletionRequest, g as AICompletionResponse, h as AIEmbeddingRequest, i as AIEmbeddingResponse, j as AIModelConfig, k as AIModelType, l as AIProvider } from './IAI-B7pp322X.mjs';
|
|
2
|
+
import { I as ICache } from './ICache-BWSuTuhz.mjs';
|
|
3
|
+
import { I as ILogger } from './ILogger-DLDBZaH4.mjs';
|
|
2
4
|
|
|
3
5
|
/**
|
|
4
6
|
* IAIUsage - Per-tenant AI token tracking and cost allocation
|
|
@@ -1,4 +1,6 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { r as AIToolCall, s as AITool, c as AIChatResponse, q as AIMessage, a as IAI, b as AIChatRequest, I as ITracing, B as ISpan, v as AIUsageInfo, d as AIStreamChunk, e as AIStreamCallback, f as AICompletionRequest, g as AICompletionResponse, h as AIEmbeddingRequest, i as AIEmbeddingResponse, j as AIModelConfig, k as AIModelType, l as AIProvider } from './IAI-B7pp322X.js';
|
|
2
|
+
import { I as ICache } from './ICache-BWSuTuhz.js';
|
|
3
|
+
import { I as ILogger } from './ILogger-DLDBZaH4.js';
|
|
2
4
|
|
|
3
5
|
/**
|
|
4
6
|
* IAIUsage - Per-tenant AI token tracking and cost allocation
|
package/dist/agents.d.mts
CHANGED
|
@@ -1,2 +1,4 @@
|
|
|
1
|
-
export { G as AgentBudget, q as AgentCumulativeUsage, s as AgentIterationCallback, r as AgentIterationEvent, u as AgentLoopOptions, v as AgentLoopResult, t as AgentStopReason, o as AgentTool, p as AgentToolResult, y as AgentTracer, x as AgentTracerOptions, F as AgentUsageRecordParams, H as AgentUsageTracker, E as AgentUsageTrackerOptions, D as DEFAULT_AGENT_LOOP_OPTIONS, O as OllamaAdapter, n as OllamaAdapterConfig, T as ToolExecutor, K as TracedAIOptions, z as createAgentTracer, J as createAgentUsageTracker, L as createTracedAI, w as runAgentLoop } from './agents-
|
|
2
|
-
import './IAI-
|
|
1
|
+
export { G as AgentBudget, q as AgentCumulativeUsage, s as AgentIterationCallback, r as AgentIterationEvent, u as AgentLoopOptions, v as AgentLoopResult, t as AgentStopReason, o as AgentTool, p as AgentToolResult, y as AgentTracer, x as AgentTracerOptions, F as AgentUsageRecordParams, H as AgentUsageTracker, E as AgentUsageTrackerOptions, D as DEFAULT_AGENT_LOOP_OPTIONS, O as OllamaAdapter, n as OllamaAdapterConfig, T as ToolExecutor, K as TracedAIOptions, z as createAgentTracer, J as createAgentUsageTracker, L as createTracedAI, w as runAgentLoop } from './agents-C7FPA8y9.mjs';
|
|
2
|
+
import './IAI-B7pp322X.mjs';
|
|
3
|
+
import './ICache-BWSuTuhz.mjs';
|
|
4
|
+
import './ILogger-DLDBZaH4.mjs';
|
package/dist/agents.d.ts
CHANGED
|
@@ -1,2 +1,4 @@
|
|
|
1
|
-
export { G as AgentBudget, q as AgentCumulativeUsage, s as AgentIterationCallback, r as AgentIterationEvent, u as AgentLoopOptions, v as AgentLoopResult, t as AgentStopReason, o as AgentTool, p as AgentToolResult, y as AgentTracer, x as AgentTracerOptions, F as AgentUsageRecordParams, H as AgentUsageTracker, E as AgentUsageTrackerOptions, D as DEFAULT_AGENT_LOOP_OPTIONS, O as OllamaAdapter, n as OllamaAdapterConfig, T as ToolExecutor, K as TracedAIOptions, z as createAgentTracer, J as createAgentUsageTracker, L as createTracedAI, w as runAgentLoop } from './agents-
|
|
2
|
-
import './IAI-
|
|
1
|
+
export { G as AgentBudget, q as AgentCumulativeUsage, s as AgentIterationCallback, r as AgentIterationEvent, u as AgentLoopOptions, v as AgentLoopResult, t as AgentStopReason, o as AgentTool, p as AgentToolResult, y as AgentTracer, x as AgentTracerOptions, F as AgentUsageRecordParams, H as AgentUsageTracker, E as AgentUsageTrackerOptions, D as DEFAULT_AGENT_LOOP_OPTIONS, O as OllamaAdapter, n as OllamaAdapterConfig, T as ToolExecutor, K as TracedAIOptions, z as createAgentTracer, J as createAgentUsageTracker, L as createTracedAI, w as runAgentLoop } from './agents-qyQ3BtXy.js';
|
|
2
|
+
import './IAI-B7pp322X.js';
|
|
3
|
+
import './ICache-BWSuTuhz.js';
|
|
4
|
+
import './ILogger-DLDBZaH4.js';
|