@agentmark-ai/shared-utils 0.2.0 → 0.3.1
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/index.d.mts +26 -3
- package/dist/index.d.ts +26 -3
- package/dist/index.js +545 -4
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +544 -4
- package/dist/index.mjs.map +1 -1
- package/package.json +4 -3
package/dist/index.d.mts
CHANGED
|
@@ -71,7 +71,7 @@ type AgentmarkConfig = {
|
|
|
71
71
|
version: string;
|
|
72
72
|
builtInModels?: string[];
|
|
73
73
|
mcpServers?: McpServers;
|
|
74
|
-
evals
|
|
74
|
+
evals?: string[];
|
|
75
75
|
};
|
|
76
76
|
|
|
77
77
|
declare function toFrontMatter(content: {
|
|
@@ -121,7 +121,8 @@ type PromptFrontmatterV0 = {
|
|
|
121
121
|
};
|
|
122
122
|
type PromptFrontmatter = PromptFrontmatterV0 | TextPromptFrontmatterV1_0 | ObjectPromptFrontmatterV1_0 | ImagePromptFrontmatterV1_0;
|
|
123
123
|
declare function findPromptFiles(dir: string): Promise<string[]>;
|
|
124
|
-
|
|
124
|
+
type GenerateTypesLanguage = "typescript" | "python";
|
|
125
|
+
declare function generateTypeDefinitions(prompts: PromptFrontmatter[], language?: GenerateTypesLanguage): Promise<string>;
|
|
125
126
|
declare function fetchPromptsFrontmatter(options: {
|
|
126
127
|
local?: number;
|
|
127
128
|
rootDir?: string;
|
|
@@ -248,6 +249,7 @@ interface NormalizedSpan {
|
|
|
248
249
|
datasetPath?: string;
|
|
249
250
|
datasetItemName?: string;
|
|
250
251
|
datasetExpectedOutput?: string;
|
|
252
|
+
datasetInput?: string;
|
|
251
253
|
promptName?: string;
|
|
252
254
|
props?: string;
|
|
253
255
|
commitSha?: string;
|
|
@@ -506,6 +508,27 @@ declare class AgentMarkTransformer implements ScopeTransformer {
|
|
|
506
508
|
*/
|
|
507
509
|
declare const AGENTMARK_SCOPE_NAME = "agentmark";
|
|
508
510
|
|
|
511
|
+
/**
|
|
512
|
+
* Transformer for the official OTel GenAI Semantic Conventions (v1.37.0+).
|
|
513
|
+
*
|
|
514
|
+
* Handles attribute names:
|
|
515
|
+
* gen_ai.input.messages — JSON array of input messages ({role, parts[]})
|
|
516
|
+
* gen_ai.output.messages — JSON array of output messages ({role, parts[], finish_reason})
|
|
517
|
+
* gen_ai.system_instructions — JSON array of system instruction parts
|
|
518
|
+
*
|
|
519
|
+
* Used by frameworks that follow the official spec:
|
|
520
|
+
* - Pydantic AI (scope: "pydantic-ai")
|
|
521
|
+
* - Any future OTel-compliant GenAI instrumentation
|
|
522
|
+
*
|
|
523
|
+
* @see https://opentelemetry.io/docs/specs/semconv/gen-ai/gen-ai-spans/
|
|
524
|
+
*/
|
|
525
|
+
|
|
526
|
+
declare class OtelGenAiTransformer implements ScopeTransformer {
|
|
527
|
+
classify(span: OtelSpan, attributes: Record<string, any>): SpanType;
|
|
528
|
+
transform(span: OtelSpan, attributes: Record<string, any>): Partial<NormalizedSpan>;
|
|
529
|
+
static readonly SCOPE_NAME = "pydantic-ai";
|
|
530
|
+
}
|
|
531
|
+
|
|
509
532
|
declare function normalizeSpan(resource: OtelResource, scope: OtelScope, span: OtelSpan): NormalizedSpan;
|
|
510
533
|
/**
|
|
511
534
|
* Normalize spans from raw OTLP resourceSpans structure
|
|
@@ -513,4 +536,4 @@ declare function normalizeSpan(resource: OtelResource, scope: OtelScope, span: O
|
|
|
513
536
|
*/
|
|
514
537
|
declare function normalizeOtlpSpans(resourceSpans: OtlpResourceSpans[]): NormalizedSpan[];
|
|
515
538
|
|
|
516
|
-
export { AGENTMARK_SCOPE_NAME, AgentMarkTransformer, type AgentmarkConfig, type AgentmarkModelConfig, type AgentmarkModelSchema, type AgentmarkModelSettingsConfig, type AgentmarkModelSettingsSchema, AiSdkTransformer, type AiSdkVersion, type AttributeExtractor, AgentMarkTransformer as ClaudeAgentTransformer, MastraTransformer, type McpServerConfig, type McpServers, type McpStdioServerConfig, type McpUrlServerConfig, type Message, type ModelSettingsTypeAspectRatio, type ModelSettingsTypeImageSize, type ModelSettingsTypeSelect, type ModelSettingsTypeSlider, type NormalizedSpan, type OtelEvent, type OtelLink, type OtelResource, type OtelScope, type OtelSpan, type OtlpAttribute, type OtlpAttributeValue, type OtlpEvent, type OtlpLink, type OtlpResource, type OtlpResourceSpans, type OtlpScope, type OtlpScopeSpans, type OtlpSpan, type ScopeTransformer, SpanType, type StandardMessageContent, type StandardTextContent, type StandardToolCallContent, type StandardToolResultContent, type ToolCall, TransformerRegistry, TypeClassifier, convertOtlpAttributes, createSignature, detectVersion, extractCustomMetadata, extractReasoningFromProviderMetadata, extractResourceScopeSpan, fetchPromptsFrontmatter, findPromptFiles, generateTypeDefinitions, generateUnique8CharString, normalizeOtlpSpans, normalizeSpan, parseAgentMarkAttributes, parseMetadata, parseTokens, registry, toFrontMatter, typeClassifier, verifySignature };
|
|
539
|
+
export { AGENTMARK_SCOPE_NAME, AgentMarkTransformer, type AgentmarkConfig, type AgentmarkModelConfig, type AgentmarkModelSchema, type AgentmarkModelSettingsConfig, type AgentmarkModelSettingsSchema, AiSdkTransformer, type AiSdkVersion, type AttributeExtractor, AgentMarkTransformer as ClaudeAgentTransformer, type GenerateTypesLanguage, MastraTransformer, type McpServerConfig, type McpServers, type McpStdioServerConfig, type McpUrlServerConfig, type Message, type ModelSettingsTypeAspectRatio, type ModelSettingsTypeImageSize, type ModelSettingsTypeSelect, type ModelSettingsTypeSlider, type NormalizedSpan, type OtelEvent, OtelGenAiTransformer, type OtelLink, type OtelResource, type OtelScope, type OtelSpan, type OtlpAttribute, type OtlpAttributeValue, type OtlpEvent, type OtlpLink, type OtlpResource, type OtlpResourceSpans, type OtlpScope, type OtlpScopeSpans, type OtlpSpan, type ScopeTransformer, SpanType, type StandardMessageContent, type StandardTextContent, type StandardToolCallContent, type StandardToolResultContent, type ToolCall, TransformerRegistry, TypeClassifier, convertOtlpAttributes, createSignature, detectVersion, extractCustomMetadata, extractReasoningFromProviderMetadata, extractResourceScopeSpan, fetchPromptsFrontmatter, findPromptFiles, generateTypeDefinitions, generateUnique8CharString, normalizeOtlpSpans, normalizeSpan, parseAgentMarkAttributes, parseMetadata, parseTokens, registry, toFrontMatter, typeClassifier, verifySignature };
|
package/dist/index.d.ts
CHANGED
|
@@ -71,7 +71,7 @@ type AgentmarkConfig = {
|
|
|
71
71
|
version: string;
|
|
72
72
|
builtInModels?: string[];
|
|
73
73
|
mcpServers?: McpServers;
|
|
74
|
-
evals
|
|
74
|
+
evals?: string[];
|
|
75
75
|
};
|
|
76
76
|
|
|
77
77
|
declare function toFrontMatter(content: {
|
|
@@ -121,7 +121,8 @@ type PromptFrontmatterV0 = {
|
|
|
121
121
|
};
|
|
122
122
|
type PromptFrontmatter = PromptFrontmatterV0 | TextPromptFrontmatterV1_0 | ObjectPromptFrontmatterV1_0 | ImagePromptFrontmatterV1_0;
|
|
123
123
|
declare function findPromptFiles(dir: string): Promise<string[]>;
|
|
124
|
-
|
|
124
|
+
type GenerateTypesLanguage = "typescript" | "python";
|
|
125
|
+
declare function generateTypeDefinitions(prompts: PromptFrontmatter[], language?: GenerateTypesLanguage): Promise<string>;
|
|
125
126
|
declare function fetchPromptsFrontmatter(options: {
|
|
126
127
|
local?: number;
|
|
127
128
|
rootDir?: string;
|
|
@@ -248,6 +249,7 @@ interface NormalizedSpan {
|
|
|
248
249
|
datasetPath?: string;
|
|
249
250
|
datasetItemName?: string;
|
|
250
251
|
datasetExpectedOutput?: string;
|
|
252
|
+
datasetInput?: string;
|
|
251
253
|
promptName?: string;
|
|
252
254
|
props?: string;
|
|
253
255
|
commitSha?: string;
|
|
@@ -506,6 +508,27 @@ declare class AgentMarkTransformer implements ScopeTransformer {
|
|
|
506
508
|
*/
|
|
507
509
|
declare const AGENTMARK_SCOPE_NAME = "agentmark";
|
|
508
510
|
|
|
511
|
+
/**
|
|
512
|
+
* Transformer for the official OTel GenAI Semantic Conventions (v1.37.0+).
|
|
513
|
+
*
|
|
514
|
+
* Handles attribute names:
|
|
515
|
+
* gen_ai.input.messages — JSON array of input messages ({role, parts[]})
|
|
516
|
+
* gen_ai.output.messages — JSON array of output messages ({role, parts[], finish_reason})
|
|
517
|
+
* gen_ai.system_instructions — JSON array of system instruction parts
|
|
518
|
+
*
|
|
519
|
+
* Used by frameworks that follow the official spec:
|
|
520
|
+
* - Pydantic AI (scope: "pydantic-ai")
|
|
521
|
+
* - Any future OTel-compliant GenAI instrumentation
|
|
522
|
+
*
|
|
523
|
+
* @see https://opentelemetry.io/docs/specs/semconv/gen-ai/gen-ai-spans/
|
|
524
|
+
*/
|
|
525
|
+
|
|
526
|
+
declare class OtelGenAiTransformer implements ScopeTransformer {
|
|
527
|
+
classify(span: OtelSpan, attributes: Record<string, any>): SpanType;
|
|
528
|
+
transform(span: OtelSpan, attributes: Record<string, any>): Partial<NormalizedSpan>;
|
|
529
|
+
static readonly SCOPE_NAME = "pydantic-ai";
|
|
530
|
+
}
|
|
531
|
+
|
|
509
532
|
declare function normalizeSpan(resource: OtelResource, scope: OtelScope, span: OtelSpan): NormalizedSpan;
|
|
510
533
|
/**
|
|
511
534
|
* Normalize spans from raw OTLP resourceSpans structure
|
|
@@ -513,4 +536,4 @@ declare function normalizeSpan(resource: OtelResource, scope: OtelScope, span: O
|
|
|
513
536
|
*/
|
|
514
537
|
declare function normalizeOtlpSpans(resourceSpans: OtlpResourceSpans[]): NormalizedSpan[];
|
|
515
538
|
|
|
516
|
-
export { AGENTMARK_SCOPE_NAME, AgentMarkTransformer, type AgentmarkConfig, type AgentmarkModelConfig, type AgentmarkModelSchema, type AgentmarkModelSettingsConfig, type AgentmarkModelSettingsSchema, AiSdkTransformer, type AiSdkVersion, type AttributeExtractor, AgentMarkTransformer as ClaudeAgentTransformer, MastraTransformer, type McpServerConfig, type McpServers, type McpStdioServerConfig, type McpUrlServerConfig, type Message, type ModelSettingsTypeAspectRatio, type ModelSettingsTypeImageSize, type ModelSettingsTypeSelect, type ModelSettingsTypeSlider, type NormalizedSpan, type OtelEvent, type OtelLink, type OtelResource, type OtelScope, type OtelSpan, type OtlpAttribute, type OtlpAttributeValue, type OtlpEvent, type OtlpLink, type OtlpResource, type OtlpResourceSpans, type OtlpScope, type OtlpScopeSpans, type OtlpSpan, type ScopeTransformer, SpanType, type StandardMessageContent, type StandardTextContent, type StandardToolCallContent, type StandardToolResultContent, type ToolCall, TransformerRegistry, TypeClassifier, convertOtlpAttributes, createSignature, detectVersion, extractCustomMetadata, extractReasoningFromProviderMetadata, extractResourceScopeSpan, fetchPromptsFrontmatter, findPromptFiles, generateTypeDefinitions, generateUnique8CharString, normalizeOtlpSpans, normalizeSpan, parseAgentMarkAttributes, parseMetadata, parseTokens, registry, toFrontMatter, typeClassifier, verifySignature };
|
|
539
|
+
export { AGENTMARK_SCOPE_NAME, AgentMarkTransformer, type AgentmarkConfig, type AgentmarkModelConfig, type AgentmarkModelSchema, type AgentmarkModelSettingsConfig, type AgentmarkModelSettingsSchema, AiSdkTransformer, type AiSdkVersion, type AttributeExtractor, AgentMarkTransformer as ClaudeAgentTransformer, type GenerateTypesLanguage, MastraTransformer, type McpServerConfig, type McpServers, type McpStdioServerConfig, type McpUrlServerConfig, type Message, type ModelSettingsTypeAspectRatio, type ModelSettingsTypeImageSize, type ModelSettingsTypeSelect, type ModelSettingsTypeSlider, type NormalizedSpan, type OtelEvent, OtelGenAiTransformer, type OtelLink, type OtelResource, type OtelScope, type OtelSpan, type OtlpAttribute, type OtlpAttributeValue, type OtlpEvent, type OtlpLink, type OtlpResource, type OtlpResourceSpans, type OtlpScope, type OtlpScopeSpans, type OtlpSpan, type ScopeTransformer, SpanType, type StandardMessageContent, type StandardTextContent, type StandardToolCallContent, type StandardToolResultContent, type ToolCall, TransformerRegistry, TypeClassifier, convertOtlpAttributes, createSignature, detectVersion, extractCustomMetadata, extractReasoningFromProviderMetadata, extractResourceScopeSpan, fetchPromptsFrontmatter, findPromptFiles, generateTypeDefinitions, generateUnique8CharString, normalizeOtlpSpans, normalizeSpan, parseAgentMarkAttributes, parseMetadata, parseTokens, registry, toFrontMatter, typeClassifier, verifySignature };
|