march-ai-sdk 0.3.0 → 0.4.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/src/artifact.ts DELETED
@@ -1,59 +0,0 @@
1
- /**
2
- * March Agent SDK - Artifact Types
3
- * Port of Python march_agent/artifact.py
4
- */
5
-
6
- import { z } from 'zod'
7
-
8
- /**
9
- * Valid artifact types for message attachments
10
- */
11
- export const ArtifactTypeSchema = z.enum([
12
- 'document',
13
- 'image',
14
- 'iframe',
15
- 'video',
16
- 'audio',
17
- 'code',
18
- 'link',
19
- 'file',
20
- ])
21
-
22
- export type ArtifactType = z.infer<typeof ArtifactTypeSchema>
23
-
24
- /**
25
- * Schema for artifact validation
26
- */
27
- export const ArtifactSchema = z.object({
28
- url: z.string(),
29
- type: ArtifactTypeSchema,
30
- title: z.string().optional(),
31
- description: z.string().optional(),
32
- metadata: z.record(z.string(), z.unknown()).optional(),
33
- })
34
-
35
- export type Artifact = z.infer<typeof ArtifactSchema>
36
-
37
- /**
38
- * Input type for adding artifacts (without strict validation)
39
- */
40
- export interface ArtifactInput {
41
- url: string
42
- type: ArtifactType | string
43
- title?: string
44
- description?: string
45
- metadata?: Record<string, unknown>
46
- }
47
-
48
- /**
49
- * Convert artifact input to validated artifact
50
- */
51
- export function toArtifact(input: ArtifactInput): Artifact {
52
- return ArtifactSchema.parse({
53
- url: input.url,
54
- type: input.type,
55
- title: input.title,
56
- description: input.description,
57
- metadata: input.metadata,
58
- })
59
- }