@happyvertical/smrt-core 0.51.29 → 0.51.32
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/agents/schema-paths.md +9 -0
- package/dist/browser.d.ts +1 -0
- package/dist/browser.d.ts.map +1 -1
- package/dist/browser.js +2 -1
- package/dist/class.d.ts +33 -0
- package/dist/class.d.ts.map +1 -1
- package/dist/class.js +77 -0
- package/dist/class.js.map +1 -1
- package/dist/collection.d.ts.map +1 -1
- package/dist/collection.js +5 -1
- package/dist/collection.js.map +1 -1
- package/dist/config.d.ts +3 -0
- package/dist/config.d.ts.map +1 -1
- package/dist/config.js.map +1 -1
- package/dist/decisions.d.ts +89 -0
- package/dist/decisions.d.ts.map +1 -0
- package/dist/decisions.js +78 -0
- package/dist/decisions.js.map +1 -0
- package/dist/generators/custom-action.d.ts.map +1 -1
- package/dist/generators/custom-action.js +2 -1
- package/dist/generators/custom-action.js.map +1 -1
- package/dist/index.d.ts +2 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +2 -1
- package/dist/manifest/static-manifest.d.ts.map +1 -1
- package/dist/manifest/static-manifest.js +17 -1
- package/dist/manifest/static-manifest.js.map +1 -1
- package/dist/manifest/store.js +1 -1
- package/dist/manifest/store.js.map +1 -1
- package/dist/manifest.json +20 -1
- package/dist/migrations/differ.d.ts +43 -1
- package/dist/migrations/differ.d.ts.map +1 -1
- package/dist/migrations/differ.js +69 -0
- package/dist/migrations/differ.js.map +1 -1
- package/dist/object.d.ts +11 -0
- package/dist/object.d.ts.map +1 -1
- package/dist/object.js +96 -2
- package/dist/object.js.map +1 -1
- package/dist/registry/shared-state.js +1 -1
- package/dist/schema/bounded-concurrency.d.ts +31 -0
- package/dist/schema/bounded-concurrency.d.ts.map +1 -0
- package/dist/schema/bounded-concurrency.js +43 -0
- package/dist/schema/bounded-concurrency.js.map +1 -0
- package/dist/schema/foreign-key-orphan-report.d.ts +21 -0
- package/dist/schema/foreign-key-orphan-report.d.ts.map +1 -1
- package/dist/schema/foreign-key-orphan-report.js +90 -55
- package/dist/schema/foreign-key-orphan-report.js.map +1 -1
- package/dist/smrt-knowledge.json +15 -5
- package/package.json +10 -10
package/dist/config.d.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { LoggerConfig } from '@happyvertical/logger';
|
|
2
2
|
import { AiUsageHandler, SignalAdapter } from '@happyvertical/smrt-types';
|
|
3
|
+
import { DecisionConfig } from './decisions.js';
|
|
3
4
|
import { SignalBus } from './signals/bus.js';
|
|
4
5
|
import { SanitizationConfig } from './signals/sanitizer.js';
|
|
5
6
|
import { RetentionPolicy } from './system/retention.js';
|
|
@@ -80,6 +81,8 @@ export interface GlobalSignalConfig {
|
|
|
80
81
|
* Provides global defaults for AI client initialization
|
|
81
82
|
*/
|
|
82
83
|
ai?: AIConfig;
|
|
84
|
+
/** Optional typed-decision configuration, independent from `ai`. */
|
|
85
|
+
decisions?: DecisionConfig;
|
|
83
86
|
/**
|
|
84
87
|
* AI usage tracking configuration (default: enabled)
|
|
85
88
|
*/
|
package/dist/config.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../src/config.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,uBAAuB,CAAC;AAC1D,OAAO,KAAK,EAAE,cAAc,EAAE,aAAa,EAAE,MAAM,2BAA2B,CAAC;AAC/E,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAClD,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,wBAAwB,CAAC;AACjE,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AAE7D;;GAEG;AACH,MAAM,WAAW,aAAa;IAC5B,8BAA8B;IAC9B,OAAO,EAAE,OAAO,CAAC;CAClB;AAED;;GAEG;AACH,MAAM,WAAW,YAA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hB,MAAM;;AAI5B,OAAO,EACL,KAAK,aAAa,EAClB,WAAW,EACX,aAAa,EACb,WAAW,EACX,oBAAoB,GACrB,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EAAE,MAAM,EAAE,CAAC"}
|
package/dist/config.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"config.js","names":[],"sources":["../src/config.ts"],"sourcesContent":["/**\n * Global SMRT configuration system\n *\n * Provides application-level defaults for signal adapters.\n * Configuration follows a three-tier pattern:\n * 1. Global defaults (via smrt.configure())\n * 2. Per-instance overrides (via SmrtClassOptions)\n * 3. Runtime behavior (from merged config)\n */\n\nimport type { LoggerConfig } from '@happyvertical/logger';\nimport type { AiUsageHandler, SignalAdapter } from '@happyvertical/smrt-types';\nimport type { SignalBus } from './signals/bus.js';\nimport type { SanitizationConfig } from './signals/sanitizer.js';\nimport type { RetentionPolicy } from './system/retention.js';\n\n/**\n * Metrics adapter configuration\n */\nexport interface MetricsConfig {\n /** Enable metrics tracking */\n enabled: boolean;\n}\n\n/**\n * Pub/Sub adapter configuration\n */\nexport interface PubSubConfig {\n /** Enable pub/sub broadcasting */\n enabled: boolean;\n}\n\n/**\n * AI provider configuration\n *\n * Global defaults for AI client initialization.\n * Provides fallback values when AI options are not specified per-instance.\n */\nexport interface AIConfig {\n /**\n * Default AI provider to use\n * Examples: 'openai', 'anthropic', 'claude-cli', 'gemini', etc.\n */\n provider?: string;\n\n /**\n * Default model to use with the provider\n * Examples: 'gpt-4', 'claude-3-opus', 'sonnet', etc.\n */\n model?: string;\n\n /**\n * Default API key for the provider\n * Can be overridden by environment variables or instance options\n */\n apiKey?: string;\n\n /**\n * Additional provider-specific options\n */\n [key: string]: unknown;\n}\n\n/**\n * AI usage tracking configuration\n */\nexport interface AiUsageConfig {\n /** Enable normalized AI usage tracking (default: true) */\n enabled?: boolean;\n\n /** Enable persistence to _smrt_ai_usage when a DB exists (default: true) */\n persist?: boolean;\n\n /** Enable best-effort cost estimation (default: true) */\n estimateCosts?: boolean;\n\n /** Override USD-per-1K-token cost rates */\n costRates?: Record<string, { input: number; output: number }>;\n\n /** Additional usage handlers */\n handlers?: AiUsageHandler[];\n}\n\n/**\n * Global signal configuration\n *\n * Application-level defaults for signal adapters.\n * These can be overridden per-instance via SmrtClassOptions.\n */\nexport interface GlobalSignalConfig {\n /** Logging configuration (default: true with console, info level) */\n logging?: LoggerConfig;\n\n /** Metrics configuration (default: undefined/disabled) */\n metrics?: MetricsConfig;\n\n /** Pub/Sub configuration (default: undefined/disabled) */\n pubsub?: PubSubConfig;\n\n /**\n * AI provider configuration (default: undefined)\n * Provides global defaults for AI client initialization\n */\n ai?: AIConfig;\n\n /**\n * AI usage tracking configuration (default: enabled)\n */\n usage?: AiUsageConfig;\n\n /**\n * Signal sanitization configuration (default: enabled with standard redactions)\n * Set to false to disable sanitization\n */\n sanitization?: SanitizationConfig | false;\n\n /**\n * System-table retention policy (#2375).\n *\n * Consumed by `smrt db:prune` and by the jobs `TaskRunner`'s periodic\n * sweep. Defaults come from `DEFAULT_RETENTION_POLICY`; set\n * `retention: { enabled: false }` to opt a deployment out entirely, or an\n * individual table to `false` to keep only that one unbounded.\n */\n retention?: RetentionPolicy;\n\n /** Custom signal configuration */\n signals?: {\n /** Shared signal bus instance */\n bus?: SignalBus;\n /** Additional custom adapters */\n adapters?: SignalAdapter[];\n };\n}\n\n/**\n * Singleton configuration manager\n *\n * Manages global SMRT configuration with sensible defaults.\n */\nclass SmrtConfig {\n private static instance: SmrtConfig;\n private config: GlobalSignalConfig = {\n logging: true, // Default: console logging at info level\n };\n\n private constructor() {}\n\n /**\n * Get singleton instance\n */\n static getInstance(): SmrtConfig {\n if (!SmrtConfig.instance) {\n SmrtConfig.instance = new SmrtConfig();\n }\n return SmrtConfig.instance;\n }\n\n /**\n * Configure global defaults\n *\n * @param config - Configuration to apply\n */\n configure(config: GlobalSignalConfig): void {\n this.config = { ...this.config, ...config };\n }\n\n /**\n * Get current configuration\n *\n * @returns Current global configuration\n */\n getConfig(): GlobalSignalConfig {\n return { ...this.config };\n }\n\n /**\n * Reset to default configuration\n */\n reset(): void {\n this.config = { logging: true };\n }\n}\n\n/**\n * Global configuration API\n *\n * Callable function with attached methods for managing SMRT configuration.\n *\n * @example\n * ```typescript\n * import { config } from '@happyvertical/smrt-core';\n *\n * // Set application-level defaults\n * config({\n * logging: { level: 'debug' },\n * metrics: { enabled: true },\n * pubsub: { enabled: false },\n * ai: {\n * provider: 'claude-cli',\n * model: 'sonnet'\n * }\n * });\n *\n * // Reset to defaults\n * config.reset();\n *\n * // Get current configuration\n * const current = config.toJSON();\n *\n * // Auto-convert to string\n * console.log(`Config: ${config}`);\n *\n * // Auto-convert to JSON\n * JSON.stringify(config);\n *\n * // All SmrtClass instances now use these defaults\n * const product = new Product({ name: 'Widget' });\n * await product.initialize();\n * // product has logging at debug level, metrics enabled, and uses claude-cli by default\n * ```\n */\nfunction config(options: GlobalSignalConfig): void {\n SmrtConfig.getInstance().configure(options);\n}\n\n/**\n * Reset configuration to defaults\n */\nconfig.reset = (): void => {\n SmrtConfig.getInstance().reset();\n};\n\n/**\n * Get current configuration as object\n * Called automatically by JSON.stringify()\n *\n * @returns Current global configuration\n */\nconfig.toJSON = (): GlobalSignalConfig => SmrtConfig.getInstance().getConfig();\n\n/**\n * Convert configuration to string\n * Called automatically in string contexts\n *\n * @returns JSON string representation of configuration\n */\nconfig.toString = (): string =>\n JSON.stringify(SmrtConfig.getInstance().getConfig(), null, 2);\n\n// Re-export env-config utilities from @happyvertical/utils\nexport {\n type ConfigOptions,\n convertType,\n loadEnvConfig,\n toCamelCase,\n toScreamingSnakeCase,\n} from '@happyvertical/utils';\nexport { config };\n"],"mappings":";;;;;;;
|
|
1
|
+
{"version":3,"file":"config.js","names":[],"sources":["../src/config.ts"],"sourcesContent":["/**\n * Global SMRT configuration system\n *\n * Provides application-level defaults for signal adapters.\n * Configuration follows a three-tier pattern:\n * 1. Global defaults (via smrt.configure())\n * 2. Per-instance overrides (via SmrtClassOptions)\n * 3. Runtime behavior (from merged config)\n */\n\nimport type { LoggerConfig } from '@happyvertical/logger';\nimport type { AiUsageHandler, SignalAdapter } from '@happyvertical/smrt-types';\nimport type { DecisionConfig } from './decisions.js';\nimport type { SignalBus } from './signals/bus.js';\nimport type { SanitizationConfig } from './signals/sanitizer.js';\nimport type { RetentionPolicy } from './system/retention.js';\n\n/**\n * Metrics adapter configuration\n */\nexport interface MetricsConfig {\n /** Enable metrics tracking */\n enabled: boolean;\n}\n\n/**\n * Pub/Sub adapter configuration\n */\nexport interface PubSubConfig {\n /** Enable pub/sub broadcasting */\n enabled: boolean;\n}\n\n/**\n * AI provider configuration\n *\n * Global defaults for AI client initialization.\n * Provides fallback values when AI options are not specified per-instance.\n */\nexport interface AIConfig {\n /**\n * Default AI provider to use\n * Examples: 'openai', 'anthropic', 'claude-cli', 'gemini', etc.\n */\n provider?: string;\n\n /**\n * Default model to use with the provider\n * Examples: 'gpt-4', 'claude-3-opus', 'sonnet', etc.\n */\n model?: string;\n\n /**\n * Default API key for the provider\n * Can be overridden by environment variables or instance options\n */\n apiKey?: string;\n\n /**\n * Additional provider-specific options\n */\n [key: string]: unknown;\n}\n\n/**\n * AI usage tracking configuration\n */\nexport interface AiUsageConfig {\n /** Enable normalized AI usage tracking (default: true) */\n enabled?: boolean;\n\n /** Enable persistence to _smrt_ai_usage when a DB exists (default: true) */\n persist?: boolean;\n\n /** Enable best-effort cost estimation (default: true) */\n estimateCosts?: boolean;\n\n /** Override USD-per-1K-token cost rates */\n costRates?: Record<string, { input: number; output: number }>;\n\n /** Additional usage handlers */\n handlers?: AiUsageHandler[];\n}\n\n/**\n * Global signal configuration\n *\n * Application-level defaults for signal adapters.\n * These can be overridden per-instance via SmrtClassOptions.\n */\nexport interface GlobalSignalConfig {\n /** Logging configuration (default: true with console, info level) */\n logging?: LoggerConfig;\n\n /** Metrics configuration (default: undefined/disabled) */\n metrics?: MetricsConfig;\n\n /** Pub/Sub configuration (default: undefined/disabled) */\n pubsub?: PubSubConfig;\n\n /**\n * AI provider configuration (default: undefined)\n * Provides global defaults for AI client initialization\n */\n ai?: AIConfig;\n\n /** Optional typed-decision configuration, independent from `ai`. */\n decisions?: DecisionConfig;\n\n /**\n * AI usage tracking configuration (default: enabled)\n */\n usage?: AiUsageConfig;\n\n /**\n * Signal sanitization configuration (default: enabled with standard redactions)\n * Set to false to disable sanitization\n */\n sanitization?: SanitizationConfig | false;\n\n /**\n * System-table retention policy (#2375).\n *\n * Consumed by `smrt db:prune` and by the jobs `TaskRunner`'s periodic\n * sweep. Defaults come from `DEFAULT_RETENTION_POLICY`; set\n * `retention: { enabled: false }` to opt a deployment out entirely, or an\n * individual table to `false` to keep only that one unbounded.\n */\n retention?: RetentionPolicy;\n\n /** Custom signal configuration */\n signals?: {\n /** Shared signal bus instance */\n bus?: SignalBus;\n /** Additional custom adapters */\n adapters?: SignalAdapter[];\n };\n}\n\n/**\n * Singleton configuration manager\n *\n * Manages global SMRT configuration with sensible defaults.\n */\nclass SmrtConfig {\n private static instance: SmrtConfig;\n private config: GlobalSignalConfig = {\n logging: true, // Default: console logging at info level\n };\n\n private constructor() {}\n\n /**\n * Get singleton instance\n */\n static getInstance(): SmrtConfig {\n if (!SmrtConfig.instance) {\n SmrtConfig.instance = new SmrtConfig();\n }\n return SmrtConfig.instance;\n }\n\n /**\n * Configure global defaults\n *\n * @param config - Configuration to apply\n */\n configure(config: GlobalSignalConfig): void {\n this.config = { ...this.config, ...config };\n }\n\n /**\n * Get current configuration\n *\n * @returns Current global configuration\n */\n getConfig(): GlobalSignalConfig {\n return { ...this.config };\n }\n\n /**\n * Reset to default configuration\n */\n reset(): void {\n this.config = { logging: true };\n }\n}\n\n/**\n * Global configuration API\n *\n * Callable function with attached methods for managing SMRT configuration.\n *\n * @example\n * ```typescript\n * import { config } from '@happyvertical/smrt-core';\n *\n * // Set application-level defaults\n * config({\n * logging: { level: 'debug' },\n * metrics: { enabled: true },\n * pubsub: { enabled: false },\n * ai: {\n * provider: 'claude-cli',\n * model: 'sonnet'\n * }\n * });\n *\n * // Reset to defaults\n * config.reset();\n *\n * // Get current configuration\n * const current = config.toJSON();\n *\n * // Auto-convert to string\n * console.log(`Config: ${config}`);\n *\n * // Auto-convert to JSON\n * JSON.stringify(config);\n *\n * // All SmrtClass instances now use these defaults\n * const product = new Product({ name: 'Widget' });\n * await product.initialize();\n * // product has logging at debug level, metrics enabled, and uses claude-cli by default\n * ```\n */\nfunction config(options: GlobalSignalConfig): void {\n SmrtConfig.getInstance().configure(options);\n}\n\n/**\n * Reset configuration to defaults\n */\nconfig.reset = (): void => {\n SmrtConfig.getInstance().reset();\n};\n\n/**\n * Get current configuration as object\n * Called automatically by JSON.stringify()\n *\n * @returns Current global configuration\n */\nconfig.toJSON = (): GlobalSignalConfig => SmrtConfig.getInstance().getConfig();\n\n/**\n * Convert configuration to string\n * Called automatically in string contexts\n *\n * @returns JSON string representation of configuration\n */\nconfig.toString = (): string =>\n JSON.stringify(SmrtConfig.getInstance().getConfig(), null, 2);\n\n// Re-export env-config utilities from @happyvertical/utils\nexport {\n type ConfigOptions,\n convertType,\n loadEnvConfig,\n toCamelCase,\n toScreamingSnakeCase,\n} from '@happyvertical/utils';\nexport { config };\n"],"mappings":";;;;;;;AAgJA,IAAM,aAAN,MAAM,WAAW;CACf,OAAe;CACf,SAAqC,EACnC,SAAS,KACX;CAEA,cAAsB,CAAC;;;;CAKvB,OAAO,cAA0B;EAC/B,IAAI,CAAC,WAAW,UACd,WAAW,WAAW,IAAI,WAAW;EAEvC,OAAO,WAAW;CACpB;;;;;;CAOA,UAAU,QAAkC;EAC1C,KAAK,SAAS;GAAE,GAAG,KAAK;GAAQ,GAAG;EAAO;CAC5C;;;;;;CAOA,YAAgC;EAC9B,OAAO,EAAE,GAAG,KAAK,OAAO;CAC1B;;;;CAKA,QAAc;EACZ,KAAK,SAAS,EAAE,SAAS,KAAK;CAChC;AACF;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAwCA,SAAS,OAAO,SAAmC;CACjD,WAAW,YAAY,CAAC,CAAC,UAAU,OAAO;AAC5C;;;;AAKA,OAAO,cAAoB;CACzB,WAAW,YAAY,CAAC,CAAC,MAAM;AACjC;;;;;;;AAQA,OAAO,eAAmC,WAAW,YAAY,CAAC,CAAC,UAAU;;;;;;;AAQ7E,OAAO,iBACL,KAAK,UAAU,WAAW,YAAY,CAAC,CAAC,UAAU,GAAG,MAAM,CAAC"}
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
import { DecisionAnswer, DecisionOptions, DecisionQuestion, DecisionRequest, DecisionResult, DecisionValue } from '@happyvertical/ai';
|
|
2
|
+
import { AiTokenUsage } from '@happyvertical/smrt-types';
|
|
3
|
+
export type { DecisionAnswer, DecisionOptions, DecisionQuestion, DecisionRequest, DecisionResult, DecisionValue, };
|
|
4
|
+
export interface DecisionConfig {
|
|
5
|
+
type: 'typesafe';
|
|
6
|
+
apiKey?: string;
|
|
7
|
+
baseUrl?: string;
|
|
8
|
+
defaultModel?: string;
|
|
9
|
+
threshold?: number;
|
|
10
|
+
uncertaintyFallback?: {
|
|
11
|
+
band: number;
|
|
12
|
+
};
|
|
13
|
+
}
|
|
14
|
+
/**
|
|
15
|
+
* Deliberately minimal runtime seam for the optional SDK capability. SMRT does
|
|
16
|
+
* not mirror the SDK's decision protocol or validation; it only detects the
|
|
17
|
+
* capability and projects the predicate result it consumes.
|
|
18
|
+
*/
|
|
19
|
+
export interface DecisionClient {
|
|
20
|
+
getCapabilities?: () => Promise<{
|
|
21
|
+
decisions?: boolean;
|
|
22
|
+
}>;
|
|
23
|
+
/**
|
|
24
|
+
* Keep injected clients source-compatible with the pre-routing seam.
|
|
25
|
+
* `executeDecision()` narrows and validates the result before consumers use
|
|
26
|
+
* it as an SDK `DecisionResult`.
|
|
27
|
+
*/
|
|
28
|
+
decide: (request: unknown, options?: unknown) => Promise<unknown>;
|
|
29
|
+
}
|
|
30
|
+
/**
|
|
31
|
+
* Calls the SDK decision capability and validates the provider-neutral result.
|
|
32
|
+
*
|
|
33
|
+
* This is deliberately a small runtime boundary: question and response shapes
|
|
34
|
+
* are the SDK contracts, imported as types, rather than copied wire protocol.
|
|
35
|
+
* It is also used for injected clients, which do not receive SDK validation.
|
|
36
|
+
*/
|
|
37
|
+
export declare function executeDecision(client: DecisionClient, request: DecisionRequest, options?: DecisionOptions): Promise<DecisionResult>;
|
|
38
|
+
export interface EvaluationResult {
|
|
39
|
+
/** The final predicate answer after the configured threshold/fallback policy. */
|
|
40
|
+
result: boolean;
|
|
41
|
+
/** Available only from a typed decision response. */
|
|
42
|
+
probability?: number;
|
|
43
|
+
/** Provider/model identity, when the underlying route makes it available. */
|
|
44
|
+
provenance?: {
|
|
45
|
+
provider: string;
|
|
46
|
+
model: string;
|
|
47
|
+
};
|
|
48
|
+
/** Provider-reported token usage, when available. */
|
|
49
|
+
usage?: AiTokenUsage;
|
|
50
|
+
/** The route selected for this evaluation. */
|
|
51
|
+
route: 'decision' | 'generative';
|
|
52
|
+
/** Present only for an explicitly configured uncertainty tie-break. */
|
|
53
|
+
fallback?: 'generative';
|
|
54
|
+
/**
|
|
55
|
+
* The decision assessment that triggered an explicit generative tie-break.
|
|
56
|
+
* It is separate from the final route's metadata so callers do not mistake
|
|
57
|
+
* a decision-provider probability for a generative-provider probability.
|
|
58
|
+
*/
|
|
59
|
+
initialDecision?: {
|
|
60
|
+
probability: number;
|
|
61
|
+
provenance: {
|
|
62
|
+
provider: string;
|
|
63
|
+
model: string;
|
|
64
|
+
};
|
|
65
|
+
usage?: AiTokenUsage;
|
|
66
|
+
};
|
|
67
|
+
}
|
|
68
|
+
export interface EvaluateOptions {
|
|
69
|
+
/** Omit object state from either provider route. */
|
|
70
|
+
includeData?: boolean;
|
|
71
|
+
/** Maximum characters of public object state included in either route. */
|
|
72
|
+
maxDataLength?: number;
|
|
73
|
+
/** Per-call inclusive predicate threshold. */
|
|
74
|
+
threshold?: number;
|
|
75
|
+
/** Per-call opt-in uncertainty policy; `false` disables a configured fallback. */
|
|
76
|
+
uncertaintyFallback?: {
|
|
77
|
+
band: number;
|
|
78
|
+
} | false;
|
|
79
|
+
/** Per-call decision model override. */
|
|
80
|
+
model?: string;
|
|
81
|
+
/** Model for an explicit generative fallback or tool route. */
|
|
82
|
+
generativeModel?: string;
|
|
83
|
+
/** Abort an in-flight provider request. */
|
|
84
|
+
signal?: AbortSignal;
|
|
85
|
+
/** Provider request deadline in milliseconds. */
|
|
86
|
+
timeout?: number;
|
|
87
|
+
}
|
|
88
|
+
export declare function assertFiniteUnitInterval(value: unknown, name: string): asserts value is number;
|
|
89
|
+
//# sourceMappingURL=decisions.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"decisions.d.ts","sourceRoot":"","sources":["../src/decisions.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,KAAK,EACV,cAAc,EACd,eAAe,EACf,gBAAgB,EAChB,eAAe,EACf,cAAc,EACd,aAAa,EACd,MAAM,mBAAmB,CAAC;AAC3B,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,2BAA2B,CAAC;AAE9D,YAAY,EACV,cAAc,EACd,eAAe,EACf,gBAAgB,EAChB,eAAe,EACf,cAAc,EACd,aAAa,GACd,CAAC;AAEF,MAAM,WAAW,cAAc;IAC7B,IAAI,EAAE,UAAU,CAAC;IACjB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,mBAAmB,CAAC,EAAE;QACpB,IAAI,EAAE,MAAM,CAAC;KACd,CAAC;CACH;AAED;;;;GAIG;AACH,MAAM,WAAW,cAAc;IAC7B,eAAe,CAAC,EAAE,MAAM,OAAO,CAAC;QAC9B,SAAS,CAAC,EAAE,OAAO,CAAC;KACrB,CAAC,CAAC;IACH;;;;O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AAM,CAAC;IACzB,2CAA2C;IAC3C,MAAM,CAAC,EAAE,WAAW,CAAC;IACrB,iDAAiD;IACjD,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB;AAED,wBAAgB,wBAAwB,CACtC,KAAK,EAAE,OAAO,EACd,IAAI,EAAE,MAAM,GACX,OAAO,CAAC,KAAK,IAAI,MAAM,CASzB"}
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
//#region src/decisions.ts
|
|
2
|
+
function asDecisionRecord(value) {
|
|
3
|
+
return value && typeof value === "object" && !Array.isArray(value) ? value : void 0;
|
|
4
|
+
}
|
|
5
|
+
function assertDecisionProbability(value, name) {
|
|
6
|
+
assertFiniteUnitInterval(value, name);
|
|
7
|
+
}
|
|
8
|
+
function assertDecisionDistribution(value, expectedKeys, name) {
|
|
9
|
+
const distribution = asDecisionRecord(value);
|
|
10
|
+
if (!distribution || Object.keys(distribution).length !== expectedKeys.length) throw new Error(`${name} must cover exactly the requested values.`);
|
|
11
|
+
let total = 0;
|
|
12
|
+
for (const key of expectedKeys) {
|
|
13
|
+
if (!Object.hasOwn(distribution, key)) throw new Error(`${name} must cover exactly the requested values.`);
|
|
14
|
+
assertDecisionProbability(distribution[key], `${name}.${key}`);
|
|
15
|
+
total += distribution[key];
|
|
16
|
+
}
|
|
17
|
+
if (Math.abs(total - 1) > 1e-6) throw new Error(`${name} must sum to 1.`);
|
|
18
|
+
}
|
|
19
|
+
function sameDecisionValue(left, right) {
|
|
20
|
+
if (left === right) return true;
|
|
21
|
+
if (Array.isArray(left)) return Array.isArray(right) && left.length === right.length && left.every((value, index) => sameDecisionValue(value, right[index]));
|
|
22
|
+
if (left && typeof left === "object") {
|
|
23
|
+
const rightRecord = asDecisionRecord(right);
|
|
24
|
+
if (!rightRecord) return false;
|
|
25
|
+
const leftEntries = Object.entries(left);
|
|
26
|
+
return leftEntries.length === Object.keys(rightRecord).length && leftEntries.every(([key, value]) => Object.hasOwn(rightRecord, key) && sameDecisionValue(value, rightRecord[key]));
|
|
27
|
+
}
|
|
28
|
+
return false;
|
|
29
|
+
}
|
|
30
|
+
/**
|
|
31
|
+
* Calls the SDK decision capability and validates the provider-neutral result.
|
|
32
|
+
*
|
|
33
|
+
* This is deliberately a small runtime boundary: question and response shapes
|
|
34
|
+
* are the SDK contracts, imported as types, rather than copied wire protocol.
|
|
35
|
+
* It is also used for injected clients, which do not receive SDK validation.
|
|
36
|
+
*/
|
|
37
|
+
async function executeDecision(client, request, options) {
|
|
38
|
+
if ((await client.getCapabilities?.())?.decisions !== true || typeof client.decide !== "function") throw new Error("The configured decision client does not support typed decisions.");
|
|
39
|
+
const result = asDecisionRecord(await client.decide(request, options));
|
|
40
|
+
if (!result) throw new Error("Decision provider returned an invalid result.");
|
|
41
|
+
const provenance = asDecisionRecord(result.provenance);
|
|
42
|
+
if (!provenance || typeof provenance.provider !== "string" || provenance.provider.length === 0 || typeof provenance.model !== "string" || provenance.model.length === 0) throw new Error("Decision provider returned invalid provenance.");
|
|
43
|
+
const answers = asDecisionRecord(result.answers);
|
|
44
|
+
const questionIds = Object.keys(request.questions);
|
|
45
|
+
if (!answers || questionIds.some((id) => !Object.hasOwn(answers, id))) throw new Error("Decision provider returned no answers.");
|
|
46
|
+
for (const [id, question] of Object.entries(request.questions)) {
|
|
47
|
+
const answer = asDecisionRecord(answers[id]);
|
|
48
|
+
if (!answer || answer.type !== question.type) throw new Error(`Decision provider returned an invalid ${question.type} result for ${id}.`);
|
|
49
|
+
if (question.type === "predicate") {
|
|
50
|
+
assertDecisionProbability(answer.probability, "Decision probability");
|
|
51
|
+
continue;
|
|
52
|
+
}
|
|
53
|
+
if (question.type === "choice") {
|
|
54
|
+
const keys = Object.keys(question.criteria);
|
|
55
|
+
if (typeof answer.choice !== "string" || !Object.hasOwn(question.criteria, answer.choice)) throw new Error(`Decision answer ${id}.choice is not a requested option.`);
|
|
56
|
+
assertDecisionDistribution(answer.probabilities, keys, `Decision answer ${id}.probabilities`);
|
|
57
|
+
assertDecisionProbability(answer.confidence, `Decision answer ${id}.confidence`);
|
|
58
|
+
continue;
|
|
59
|
+
}
|
|
60
|
+
if (typeof answer.score !== "number" || !Number.isFinite(answer.score) || answer.score < 0 || answer.score > question.criteria.length - 1) throw new Error(`Decision answer ${id}.score is outside the requested rubric.`);
|
|
61
|
+
const levelKeys = question.criteria.map((_, index) => String(index));
|
|
62
|
+
assertDecisionDistribution(answer.probabilities, levelKeys, `Decision answer ${id}.probabilities`);
|
|
63
|
+
assertDecisionProbability(answer.confidence, `Decision answer ${id}.confidence`);
|
|
64
|
+
const answerLevels = Array.isArray(answer.levels) ? answer.levels : void 0;
|
|
65
|
+
if (!answerLevels || answerLevels.length !== question.criteria.length || !question.criteria.every((level, index) => sameDecisionValue(level, answerLevels[index]))) throw new Error(`Decision answer ${id}.levels does not match the requested rubric.`);
|
|
66
|
+
}
|
|
67
|
+
return {
|
|
68
|
+
...result,
|
|
69
|
+
model: provenance.model
|
|
70
|
+
};
|
|
71
|
+
}
|
|
72
|
+
function assertFiniteUnitInterval(value, name) {
|
|
73
|
+
if (typeof value !== "number" || !Number.isFinite(value) || value < 0 || value > 1) throw new Error(`${name} must be a finite number in [0, 1].`);
|
|
74
|
+
}
|
|
75
|
+
//#endregion
|
|
76
|
+
export { assertFiniteUnitInterval, executeDecision };
|
|
77
|
+
|
|
78
|
+
//# sourceMappingURL=decisions.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"decisions.js","names":[],"sources":["../src/decisions.ts"],"sourcesContent":["/**\n * Provider-neutral decision contracts consumed by {@link SmrtObject.evaluate}.\n *\n * The SDK owns the wire protocol and provider translation. These small\n * structural contracts keep the optional SDK capability out of the ordinary\n * object cold path while still making the SMRT result and configuration public.\n */\n\nimport type {\n DecisionAnswer,\n DecisionOptions,\n DecisionQuestion,\n DecisionRequest,\n DecisionResult,\n DecisionValue,\n} from '@happyvertical/ai';\nimport type { AiTokenUsage } from '@happyvertical/smrt-types';\n\nexport type {\n DecisionAnswer,\n DecisionOptions,\n DecisionQuestion,\n DecisionRequest,\n DecisionResult,\n DecisionValue,\n};\n\nexport interface DecisionConfig {\n type: 'typesafe';\n apiKey?: string;\n baseUrl?: string;\n defaultModel?: string;\n threshold?: number;\n uncertaintyFallback?: {\n band: number;\n };\n}\n\n/**\n * Deliberately minimal runtime seam for the optional SDK capability. SMRT does\n * not mirror the SDK's decision protocol or validation; it only detects the\n * capability and projects the predicate result it consumes.\n */\nexport interface DecisionClient {\n getCapabilities?: () => Promise<{\n decisions?: boolean;\n }>;\n /**\n * Keep injected clients source-compatible with the pre-routing seam.\n * `executeDecision()` narrows and validates the result before consumers use\n * it as an SDK `DecisionResult`.\n */\n decide: (request: unknown, options?: unknown) => Promise<unknown>;\n}\n\nfunction asDecisionRecord(value: unknown): Record<string, unknown> | undefined {\n return value && typeof value === 'object' && !Array.isArray(value)\n ? (value as Record<string, unknown>)\n : undefined;\n}\n\nfunction assertDecisionProbability(value: unknown, name: string): void {\n assertFiniteUnitInterval(value, name);\n}\n\nfunction assertDecisionDistribution(\n value: unknown,\n expectedKeys: readonly string[],\n name: string,\n): void {\n const distribution = asDecisionRecord(value);\n if (\n !distribution ||\n Object.keys(distribution).length !== expectedKeys.length\n ) {\n throw new Error(`${name} must cover exactly the requested values.`);\n }\n let total = 0;\n for (const key of expectedKeys) {\n if (!Object.hasOwn(distribution, key)) {\n throw new Error(`${name} must cover exactly the requested values.`);\n }\n assertDecisionProbability(distribution[key], `${name}.${key}`);\n total += distribution[key] as number;\n }\n if (Math.abs(total - 1) > 1e-6) {\n throw new Error(`${name} must sum to 1.`);\n }\n}\n\nfunction sameDecisionValue(left: DecisionValue, right: unknown): boolean {\n if (left === right) return true;\n if (Array.isArray(left)) {\n return (\n Array.isArray(right) &&\n left.length === right.length &&\n left.every((value, index) => sameDecisionValue(value, right[index]))\n );\n }\n if (left && typeof left === 'object') {\n const rightRecord = asDecisionRecord(right);\n if (!rightRecord) return false;\n const leftEntries = Object.entries(left);\n return (\n leftEntries.length === Object.keys(rightRecord).length &&\n leftEntries.every(\n ([key, value]) =>\n Object.hasOwn(rightRecord, key) &&\n sameDecisionValue(value, rightRecord[key]),\n )\n );\n }\n return false;\n}\n\n/**\n * Calls the SDK decision capability and validates the provider-neutral result.\n *\n * This is deliberately a small runtime boundary: question and response shapes\n * are the SDK contracts, imported as types, rather than copied wire protocol.\n * It is also used for injected clients, which do not receive SDK validation.\n */\nexport async function executeDecision(\n client: DecisionClient,\n request: DecisionRequest,\n options?: DecisionOptions,\n): Promise<DecisionResult> {\n const capabilities = await client.getCapabilities?.();\n if (capabilities?.decisions !== true || typeof client.decide !== 'function') {\n throw new Error(\n 'The configured decision client does not support typed decisions.',\n );\n }\n\n const rawResult = await client.decide(request, options);\n const result = asDecisionRecord(rawResult);\n if (!result) {\n throw new Error('Decision provider returned an invalid result.');\n }\n const provenance = asDecisionRecord(result.provenance);\n if (\n !provenance ||\n typeof provenance.provider !== 'string' ||\n provenance.provider.length === 0 ||\n typeof provenance.model !== 'string' ||\n provenance.model.length === 0\n ) {\n throw new Error('Decision provider returned invalid provenance.');\n }\n\n const answers = asDecisionRecord(result.answers);\n const questionIds = Object.keys(request.questions);\n if (!answers || questionIds.some((id) => !Object.hasOwn(answers, id))) {\n throw new Error('Decision provider returned no answers.');\n }\n for (const [id, question] of Object.entries(request.questions)) {\n const answer = asDecisionRecord(answers[id]);\n if (!answer || answer.type !== question.type) {\n throw new Error(\n `Decision provider returned an invalid ${question.type} result for ${id}.`,\n );\n }\n if (question.type === 'predicate') {\n assertDecisionProbability(answer.probability, 'Decision probability');\n continue;\n }\n if (question.type === 'choice') {\n const keys = Object.keys(question.criteria);\n if (\n typeof answer.choice !== 'string' ||\n !Object.hasOwn(question.criteria, answer.choice)\n ) {\n throw new Error(\n `Decision answer ${id}.choice is not a requested option.`,\n );\n }\n assertDecisionDistribution(\n answer.probabilities,\n keys,\n `Decision answer ${id}.probabilities`,\n );\n assertDecisionProbability(\n answer.confidence,\n `Decision answer ${id}.confidence`,\n );\n continue;\n }\n if (\n typeof answer.score !== 'number' ||\n !Number.isFinite(answer.score) ||\n answer.score < 0 ||\n answer.score > question.criteria.length - 1\n ) {\n throw new Error(\n `Decision answer ${id}.score is outside the requested rubric.`,\n );\n }\n const levelKeys = question.criteria.map((_, index) => String(index));\n assertDecisionDistribution(\n answer.probabilities,\n levelKeys,\n `Decision answer ${id}.probabilities`,\n );\n assertDecisionProbability(\n answer.confidence,\n `Decision answer ${id}.confidence`,\n );\n const answerLevels = Array.isArray(answer.levels)\n ? answer.levels\n : undefined;\n if (\n !answerLevels ||\n answerLevels.length !== question.criteria.length ||\n !question.criteria.every((level, index) =>\n sameDecisionValue(level, answerLevels[index]),\n )\n ) {\n throw new Error(\n `Decision answer ${id}.levels does not match the requested rubric.`,\n );\n }\n }\n\n // `evaluate()` historically accepted injected predicate results whose model\n // lived only in provenance. Keep that source-compatible runtime shape while\n // presenting the SDK result contract to new typed callers. Provenance is the\n // validated provider identity, so it also normalizes redundant model metadata.\n return {\n ...result,\n model: provenance.model,\n } as DecisionResult;\n}\n\nexport interface EvaluationResult {\n /** The final predicate answer after the configured threshold/fallback policy. */\n result: boolean;\n /** Available only from a typed decision response. */\n probability?: number;\n /** Provider/model identity, when the underlying route makes it available. */\n provenance?: {\n provider: string;\n model: string;\n };\n /** Provider-reported token usage, when available. */\n usage?: AiTokenUsage;\n /** The route selected for this evaluation. */\n route: 'decision' | 'generative';\n /** Present only for an explicitly configured uncertainty tie-break. */\n fallback?: 'generative';\n /**\n * The decision assessment that triggered an explicit generative tie-break.\n * It is separate from the final route's metadata so callers do not mistake\n * a decision-provider probability for a generative-provider probability.\n */\n initialDecision?: {\n probability: number;\n provenance: {\n provider: string;\n model: string;\n };\n usage?: AiTokenUsage;\n };\n}\n\nexport interface EvaluateOptions {\n /** Omit object state from either provider route. */\n includeData?: boolean;\n /** Maximum characters of public object state included in either route. */\n maxDataLength?: number;\n /** Per-call inclusive predicate threshold. */\n threshold?: number;\n /** Per-call opt-in uncertainty policy; `false` disables a configured fallback. */\n uncertaintyFallback?:\n | {\n band: number;\n }\n | false;\n /** Per-call decision model override. */\n model?: string;\n /** Model for an explicit generative fallback or tool route. */\n generativeModel?: string;\n /** Abort an in-flight provider request. */\n signal?: AbortSignal;\n /** Provider request deadline in milliseconds. */\n timeout?: number;\n}\n\nexport function assertFiniteUnitInterval(\n value: unknown,\n name: string,\n): asserts value is number {\n if (\n typeof value !== 'number' ||\n !Number.isFinite(value) ||\n value < 0 ||\n value > 1\n ) {\n throw new Error(`${name} must be a finite number in [0, 1].`);\n }\n}\n"],"mappings":";AAuDA,SAAS,iBAAiB,OAAqD;CAC7E,OAAO,SAAS,OAAO,UAAU,YAAY,CAAC,MAAM,QAAQ,KAAK,IAC5D,QACD,KAAA;AACN;AAEA,SAAS,0BAA0B,OAAgB,MAAoB;CACrE,yBAAyB,OAAO,IAAI;AACtC;AAEA,SAAS,2BACP,OACA,cACA,MACM;CACN,MAAM,eAAe,iBAAiB,KAAK;CAC3C,IACE,CAAC,gBACD,OAAO,KAAK,YAAY,CAAC,CAAC,WAAW,aAAa,QAElD,MAAM,IAAI,MAAM,GAAG,KAAK,0CAA0C;CAEpE,IAAI,QAAQ;CACZ,KAAK,MAAM,OAAO,cAAc;EAC9B,IAAI,CAAC,OAAO,OAAO,cAAc,GAAG,GAClC,MAAM,IAAI,MAAM,GAAG,KAAK,0CAA0C;EAEpE,0BAA0B,aAAa,MAAM,GAAG,KAAK,GAAG,KAAK;EAC7D,SAAS,aAAa;CACxB;CACA,IAAI,KAAK,IAAI,QAAQ,CAAC,IAAI,MACxB,MAAM,IAAI,MAAM,GAAG,KAAK,gBAAgB;AAE5C;AAEA,SAAS,kBAAkB,MAAqB,OAAyB;CACvE,IAAI,SAAS,OAAO,OAAO;CAC3B,IAAI,MAAM,QAAQ,IAAI,GACpB,OACE,MAAM,QAAQ,KAAK,KACnB,KAAK,WAAW,MAAM,UACtB,KAAK,OAAO,OAAO,UAAU,kBA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;GACjC,0BAA0B,OAAO,aAAa,sBAAsB;GACpE;EACF;EACA,IAAI,SAAS,SAAS,UAAU;GAC9B,MAAM,OAAO,OAAO,KAAK,SAAS,QAAQ;GAC1C,IACE,OAAO,OAAO,WAAW,YACzB,CAAC,OAAO,OAAO,SAAS,UAAU,OAAO,MAAM,GAE/C,MAAM,IAAI,MACR,mBAAmB,GAAG,mCACxB;GAEF,2BACE,OAAO,eACP,MACA,mBAAmB,GAAG,eACxB;GACA,0BACE,OAAO,YACP,mBAAmB,GAAG,YACxB;GACA;EACF;EACA,IACE,OAAO,OAAO,UAAU,YACxB,CAAC,OAAO,SAAS,OAAO,KAAK,KAC7B,OAAO,QAAQ,KACf,OAAO,QAAQ,SAAS,SAAS,SAAS,GAE1C,MAAM,IAAI,MACR,mBAAmB,GAAG,wCACxB;EAEF,MAAM,YAAY,SAAS,SAAS,KAAK,GAAG,UAAU,OAAO,KAAK,CAAC;EACnE,2BACE,OAAO,eACP,WACA,mBAAmB,GAAG,eACxB;EACA,0BACE,OAAO,YACP,mBAAmB,GAAG,YACxB;EACA,MAAM,eAAe,MAAM,QAAQ,OAAO,MAAM,IAC5C,OAAO,SACP,KAAA;EACJ,IACE,CAAC,gBACD,aAAa,WAAW,SAAS,SAAS,UAC1C,CAAC,SAAS,SAAS,OAAO,OAAO,UAC/B,kBAAkB,OAAO,aAAa,MAAM,CAC9C,GAEA,MAAM,IAAI,MACR,mBAAmB,GAAG,6CACxB;CAEJ;CAMA,OAAO;EACL,GAAG;EACH,OAAO,WAAW;CACpB;AACF;AAwDA,SAAgB,yBACd,OACA,MACyB;CACzB,IACE,OAAO,UAAU,YACjB,CAAC,OAAO,SAAS,KAAK,KACtB,QAAQ,KACR,QAAQ,GAER,MAAM,IAAI,MAAM,GAAG,KAAK,oCAAoC;AAEhE"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"custom-action.d.ts","sourceRoot":"","sources":["../../src/generators/custom-action.ts"],"names":[],"mappings":"AAA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AAM,EAAE,eAAe,GAAG,SAAS,GAClC,OAAO,CAYT;AAED;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AACH,wBAAgB,0BAA0B,CACxC,KAAK,EAAE,OAAO,EACd,YAAY,EAAE,MAAM,GAAG,SAAS,GAC/B,OAAO,CAGT;AAED;;;;;;;GAOG;AACH,wBAAgB,kBAAkB,CAAC,KAAK,EAAE,OAAO,GAAG,OAAO,CAQ1D;AAED;;;;;;;;;;GAUG;AACH,wBAAgB,oBAAoB,CAAC,KAAK,EAAE,OAAO,GAAG,OAAO,CAK5D;AAED;;;;;;GAMG;AACH,wBAAgB,qBAAqB,CAAC,KAAK,EAAE,OAAO,GAAG,OAAO,CAO7D;AAED;;;;;;;GAOG;AACH,wBAAgB,qBAAqB,CACnC,YAAY,EAAE,MAAM,GAAG,SAAS,GAE9B,oBAAoB,GACpB,sBAAsB,GACtB,uBAAuB,GACvB,SAAS,CAcZ;AAED;;;;;;;;GAQG;AACH,wBAAgB,uBAAuB,CAAC,YAAY,EAAE,MAAM,GAAG,OAAO,CAMrE"}
|
|
@@ -92,7 +92,8 @@ var FRAMEWORK_LIFECYCLE_METHOD_NAMES = /* @__PURE__ */ new Set([
|
|
|
92
92
|
"loadFromSlug",
|
|
93
93
|
"markAsPersisted",
|
|
94
94
|
"requireInsertOnSave",
|
|
95
|
-
"withTransaction"
|
|
95
|
+
"withTransaction",
|
|
96
|
+
"evaluate"
|
|
96
97
|
]);
|
|
97
98
|
/**
|
|
98
99
|
* True when `methodName` is one of the universal `SmrtObject`/`SmrtClass`
|