@mdxui/do 2.1.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/README.md +412 -0
- package/dist/__test-utils__/index.d.ts +399 -0
- package/dist/__test-utils__/index.js +34641 -0
- package/dist/__test-utils__/index.js.map +1 -0
- package/dist/agents-xcIn2dUB.d.ts +832 -0
- package/dist/chunk-EEDMN7UF.js +1351 -0
- package/dist/chunk-EEDMN7UF.js.map +1 -0
- package/dist/chunk-G3PMV62Z.js +33 -0
- package/dist/chunk-G3PMV62Z.js.map +1 -0
- package/dist/chunk-GGO5GW72.js +695 -0
- package/dist/chunk-GGO5GW72.js.map +1 -0
- package/dist/chunk-GKSP5RIA.js +3 -0
- package/dist/chunk-GKSP5RIA.js.map +1 -0
- package/dist/chunk-NXPXL5NA.js +3789 -0
- package/dist/chunk-NXPXL5NA.js.map +1 -0
- package/dist/chunk-PC5FJY6M.js +20 -0
- package/dist/chunk-PC5FJY6M.js.map +1 -0
- package/dist/chunk-XF6LKY2M.js +445 -0
- package/dist/chunk-XF6LKY2M.js.map +1 -0
- package/dist/components/index.d.ts +813 -0
- package/dist/components/index.js +8 -0
- package/dist/components/index.js.map +1 -0
- package/dist/do-CaQVueZw.d.ts +195 -0
- package/dist/hooks/index.d.ts +801 -0
- package/dist/hooks/index.js +7 -0
- package/dist/hooks/index.js.map +1 -0
- package/dist/index.d.ts +1012 -0
- package/dist/index.js +843 -0
- package/dist/index.js.map +1 -0
- package/dist/magic-string.es-J7BYFTTJ.js +1307 -0
- package/dist/magic-string.es-J7BYFTTJ.js.map +1 -0
- package/dist/providers/index.d.ts +90 -0
- package/dist/providers/index.js +5 -0
- package/dist/providers/index.js.map +1 -0
- package/dist/schemas/index.d.ts +206 -0
- package/dist/schemas/index.js +262 -0
- package/dist/schemas/index.js.map +1 -0
- package/dist/thing-DtI25yZh.d.ts +902 -0
- package/dist/types/index.d.ts +7681 -0
- package/dist/types/index.js +5 -0
- package/dist/types/index.js.map +1 -0
- package/package.json +94 -0
|
@@ -0,0 +1,262 @@
|
|
|
1
|
+
import '../chunk-G3PMV62Z.js';
|
|
2
|
+
import { z } from 'zod';
|
|
3
|
+
|
|
4
|
+
var DateSchema = z.coerce.date();
|
|
5
|
+
var OptionalDateSchema = z.union([DateSchema, z.null()]).optional();
|
|
6
|
+
var EntityReferenceSchema = z.object({
|
|
7
|
+
/** Namespace */
|
|
8
|
+
ns: z.string(),
|
|
9
|
+
/** Entity type */
|
|
10
|
+
type: z.string(),
|
|
11
|
+
/** Entity ID */
|
|
12
|
+
id: z.string(),
|
|
13
|
+
/** Semantic ID (ns/type/id) */
|
|
14
|
+
semanticId: z.string(),
|
|
15
|
+
/** Display name (if loaded) */
|
|
16
|
+
name: z.string().optional()
|
|
17
|
+
});
|
|
18
|
+
var TokenUsageSchema = z.object({
|
|
19
|
+
/** Input/prompt tokens */
|
|
20
|
+
inputTokens: z.number(),
|
|
21
|
+
/** Output/completion tokens */
|
|
22
|
+
outputTokens: z.number(),
|
|
23
|
+
/** Total tokens (input + output) */
|
|
24
|
+
totalTokens: z.number(),
|
|
25
|
+
/** Thinking tokens (for reasoning models like o1, Claude with thinking) */
|
|
26
|
+
thinkingTokens: z.number().optional(),
|
|
27
|
+
/** Estimated cost in USD */
|
|
28
|
+
costUsd: z.number().optional()
|
|
29
|
+
});
|
|
30
|
+
var ExecutionErrorSchema = z.object({
|
|
31
|
+
/** Error code (e.g., 'TIMEOUT', 'VALIDATION_ERROR', 'RATE_LIMITED') */
|
|
32
|
+
code: z.string(),
|
|
33
|
+
/** Human-readable error message */
|
|
34
|
+
message: z.string(),
|
|
35
|
+
/** Stack trace (for debugging) */
|
|
36
|
+
stack: z.string().optional(),
|
|
37
|
+
/** ID of the step that failed (for workflow executions) */
|
|
38
|
+
failedStep: z.string().optional(),
|
|
39
|
+
/** Number of retry attempts made (for function executions) */
|
|
40
|
+
retryCount: z.number().optional(),
|
|
41
|
+
/** Whether this error is retryable (for function executions) */
|
|
42
|
+
retryable: z.boolean().optional()
|
|
43
|
+
});
|
|
44
|
+
var SortDirectionSchema = z.enum(["asc", "desc"]);
|
|
45
|
+
var PaginationSchema = z.object({
|
|
46
|
+
/** Page number (1-indexed) */
|
|
47
|
+
page: z.number().int().positive(),
|
|
48
|
+
/** Items per page */
|
|
49
|
+
perPage: z.number().int().positive()
|
|
50
|
+
});
|
|
51
|
+
var PaginatedResponseSchema = (dataSchema) => z.object({
|
|
52
|
+
/** Array of items for the current page */
|
|
53
|
+
data: z.array(dataSchema),
|
|
54
|
+
/** Total number of items across all pages */
|
|
55
|
+
total: z.number(),
|
|
56
|
+
/** Current page number (1-indexed) */
|
|
57
|
+
page: z.number(),
|
|
58
|
+
/** Items per page */
|
|
59
|
+
perPage: z.number(),
|
|
60
|
+
/** Total number of pages */
|
|
61
|
+
totalPages: z.number()
|
|
62
|
+
});
|
|
63
|
+
var ThingDataSchema = z.object({
|
|
64
|
+
/** JSON-LD context */
|
|
65
|
+
"@context": z.union([z.string(), z.record(z.unknown())]).optional(),
|
|
66
|
+
/** JSON-LD type (should match Thing.type) */
|
|
67
|
+
"@type": z.string().optional(),
|
|
68
|
+
/** JSON-LD identifier */
|
|
69
|
+
"@id": z.string().optional()
|
|
70
|
+
}).passthrough();
|
|
71
|
+
var ThingSchema = z.object({
|
|
72
|
+
/** Namespace (tenant/domain) */
|
|
73
|
+
ns: z.string(),
|
|
74
|
+
/** Entity type (e.g., 'Person', 'Organization', 'Agent') */
|
|
75
|
+
type: z.string(),
|
|
76
|
+
/** Unique identifier within namespace/type */
|
|
77
|
+
id: z.string(),
|
|
78
|
+
/** Version timestamp for deduplication */
|
|
79
|
+
ts: DateSchema,
|
|
80
|
+
/** Display name */
|
|
81
|
+
name: z.string(),
|
|
82
|
+
/** Creation timestamp */
|
|
83
|
+
createdAt: DateSchema,
|
|
84
|
+
/** Last update timestamp */
|
|
85
|
+
updatedAt: DateSchema,
|
|
86
|
+
/** Creator user ID */
|
|
87
|
+
createdBy: z.string().optional(),
|
|
88
|
+
/** Last updater user ID */
|
|
89
|
+
updatedBy: z.string().optional(),
|
|
90
|
+
/** Soft delete timestamp */
|
|
91
|
+
deletedAt: OptionalDateSchema,
|
|
92
|
+
/** A/B test variant */
|
|
93
|
+
variant: z.string().optional(),
|
|
94
|
+
/** JSON-LD data blob */
|
|
95
|
+
data: ThingDataSchema
|
|
96
|
+
});
|
|
97
|
+
var ThingFilterSchema = z.object({
|
|
98
|
+
/** Filter by namespace - single string or array of strings */
|
|
99
|
+
ns: z.union([z.string(), z.array(z.string())]).optional(),
|
|
100
|
+
/** Filter by type - single string or array of strings */
|
|
101
|
+
type: z.union([z.string(), z.array(z.string())]).optional(),
|
|
102
|
+
/** Filter by ID pattern (supports wildcards) */
|
|
103
|
+
idPattern: z.string().optional(),
|
|
104
|
+
/** Filter by name (case-insensitive search) */
|
|
105
|
+
nameSearch: z.string().optional(),
|
|
106
|
+
/** Filter by creation date range - start */
|
|
107
|
+
createdAfter: z.coerce.date().optional(),
|
|
108
|
+
/** Filter by creation date range - end */
|
|
109
|
+
createdBefore: z.coerce.date().optional(),
|
|
110
|
+
/** Filter by update date range - start */
|
|
111
|
+
updatedAfter: z.coerce.date().optional(),
|
|
112
|
+
/** Filter by update date range - end */
|
|
113
|
+
updatedBefore: z.coerce.date().optional(),
|
|
114
|
+
/** Include soft-deleted things */
|
|
115
|
+
includeDeleted: z.boolean().optional(),
|
|
116
|
+
/** Filter by specific property values in data */
|
|
117
|
+
properties: z.record(z.unknown()).optional(),
|
|
118
|
+
/** Filter by variant */
|
|
119
|
+
variant: z.string().optional()
|
|
120
|
+
}).passthrough();
|
|
121
|
+
var ThingSortSchema = z.object({
|
|
122
|
+
/** Field to sort by */
|
|
123
|
+
field: z.enum(["name", "createdAt", "updatedAt", "ts", "type"]),
|
|
124
|
+
/** Sort direction */
|
|
125
|
+
order: SortDirectionSchema
|
|
126
|
+
});
|
|
127
|
+
var ThingPaginationSchema = z.object({
|
|
128
|
+
/** Page number (1-indexed, must be positive) */
|
|
129
|
+
page: z.number().int().positive(),
|
|
130
|
+
/** Items per page (must be positive, max 1000) */
|
|
131
|
+
perPage: z.number().int().positive().max(1e3)
|
|
132
|
+
});
|
|
133
|
+
var ThingQueryResultSchema = z.object({
|
|
134
|
+
/** Matching things */
|
|
135
|
+
data: z.array(ThingSchema),
|
|
136
|
+
/** Total count (without pagination) */
|
|
137
|
+
total: z.number(),
|
|
138
|
+
/** Current page */
|
|
139
|
+
page: z.number(),
|
|
140
|
+
/** Items per page */
|
|
141
|
+
perPage: z.number(),
|
|
142
|
+
/** Total pages */
|
|
143
|
+
totalPages: z.number()
|
|
144
|
+
});
|
|
145
|
+
var ThingCreateInputSchema = z.object({
|
|
146
|
+
/** Namespace (required, non-empty string) */
|
|
147
|
+
ns: z.string().min(1, "Namespace is required"),
|
|
148
|
+
/** Type (required, non-empty string) */
|
|
149
|
+
type: z.string().min(1, "Type is required"),
|
|
150
|
+
/** ID (optional, auto-generated if not provided) */
|
|
151
|
+
id: z.string().optional(),
|
|
152
|
+
/** Display name (required, non-empty string) */
|
|
153
|
+
name: z.string().min(1, "Name is required"),
|
|
154
|
+
/** JSON-LD data */
|
|
155
|
+
data: ThingDataSchema,
|
|
156
|
+
/** Variant for A/B testing */
|
|
157
|
+
variant: z.string().optional()
|
|
158
|
+
});
|
|
159
|
+
var ThingUpdateInputSchema = z.object({
|
|
160
|
+
/** Updated name */
|
|
161
|
+
name: z.string().min(1, "Name cannot be empty").optional(),
|
|
162
|
+
/** Updated data (merged with existing) */
|
|
163
|
+
data: ThingDataSchema.partial().optional(),
|
|
164
|
+
/** Updated variant */
|
|
165
|
+
variant: z.string().optional()
|
|
166
|
+
});
|
|
167
|
+
var ThingDeleteOptionsSchema = z.object({
|
|
168
|
+
/** Hard delete (permanent) vs soft delete */
|
|
169
|
+
hard: z.boolean().optional()
|
|
170
|
+
});
|
|
171
|
+
var ThingVersionSchema = z.object({
|
|
172
|
+
/** Event ID */
|
|
173
|
+
eventId: z.string(),
|
|
174
|
+
/** Event type (create, update, delete) */
|
|
175
|
+
eventType: z.enum(["create", "update", "delete", "create_version", "update_version"]),
|
|
176
|
+
/** Version timestamp */
|
|
177
|
+
ts: DateSchema,
|
|
178
|
+
/** User who made the change */
|
|
179
|
+
userId: z.string(),
|
|
180
|
+
/** Full data snapshot at this version */
|
|
181
|
+
data: ThingDataSchema,
|
|
182
|
+
/** Delta from previous version */
|
|
183
|
+
delta: ThingDataSchema.optional(),
|
|
184
|
+
/** Event metadata */
|
|
185
|
+
metadata: z.record(z.unknown())
|
|
186
|
+
});
|
|
187
|
+
var SemanticPropertySchema = z.object({
|
|
188
|
+
/** Property name */
|
|
189
|
+
name: z.string(),
|
|
190
|
+
/** Property label */
|
|
191
|
+
label: z.string(),
|
|
192
|
+
/** Property description */
|
|
193
|
+
description: z.string(),
|
|
194
|
+
/** Expected value types */
|
|
195
|
+
rangeIncludes: z.array(z.string()),
|
|
196
|
+
/** Types that use this property */
|
|
197
|
+
domainIncludes: z.array(z.string()),
|
|
198
|
+
/** Is this property required? */
|
|
199
|
+
required: z.boolean(),
|
|
200
|
+
/** Is this property an array? */
|
|
201
|
+
isArray: z.boolean(),
|
|
202
|
+
/** Default value */
|
|
203
|
+
defaultValue: z.unknown().optional()
|
|
204
|
+
});
|
|
205
|
+
var SemanticTypeSchema = z.object({
|
|
206
|
+
/** Type namespace (e.g., 'schema.org') */
|
|
207
|
+
namespace: z.string(),
|
|
208
|
+
/** Type name (e.g., 'Person') */
|
|
209
|
+
name: z.string(),
|
|
210
|
+
/** Full semantic ID */
|
|
211
|
+
id: z.string(),
|
|
212
|
+
/** Human-readable label */
|
|
213
|
+
label: z.string(),
|
|
214
|
+
/** Type description */
|
|
215
|
+
description: z.string(),
|
|
216
|
+
/** Parent types (inheritance) */
|
|
217
|
+
parentTypes: z.array(z.string()),
|
|
218
|
+
/** Properties defined by this type */
|
|
219
|
+
properties: z.array(SemanticPropertySchema),
|
|
220
|
+
/** Child types */
|
|
221
|
+
subtypes: z.array(z.string()),
|
|
222
|
+
/** Example instances */
|
|
223
|
+
examples: z.array(ThingDataSchema).optional()
|
|
224
|
+
});
|
|
225
|
+
var NamespaceSchema = z.object({
|
|
226
|
+
/** Namespace identifier */
|
|
227
|
+
id: z.string(),
|
|
228
|
+
/** Namespace name */
|
|
229
|
+
name: z.string(),
|
|
230
|
+
/** Namespace description */
|
|
231
|
+
description: z.string().optional(),
|
|
232
|
+
/** Base URL for the namespace */
|
|
233
|
+
baseUrl: z.string().optional(),
|
|
234
|
+
/** Available types in this namespace */
|
|
235
|
+
types: z.array(z.string()),
|
|
236
|
+
/** Thing count in this namespace */
|
|
237
|
+
thingCount: z.number(),
|
|
238
|
+
/** Creation timestamp */
|
|
239
|
+
createdAt: DateSchema
|
|
240
|
+
});
|
|
241
|
+
var TypeStatsSchema = z.object({
|
|
242
|
+
/** Type name */
|
|
243
|
+
type: z.string(),
|
|
244
|
+
/** Namespace */
|
|
245
|
+
ns: z.string(),
|
|
246
|
+
/** Total count */
|
|
247
|
+
count: z.number(),
|
|
248
|
+
/** Active count (not deleted) */
|
|
249
|
+
activeCount: z.number(),
|
|
250
|
+
/** Created today */
|
|
251
|
+
createdToday: z.number(),
|
|
252
|
+
/** Updated today */
|
|
253
|
+
updatedToday: z.number(),
|
|
254
|
+
/** Most recent creation */
|
|
255
|
+
lastCreatedAt: DateSchema.optional(),
|
|
256
|
+
/** Most recent update */
|
|
257
|
+
lastUpdatedAt: DateSchema.optional()
|
|
258
|
+
});
|
|
259
|
+
|
|
260
|
+
export { DateSchema, EntityReferenceSchema, ExecutionErrorSchema, NamespaceSchema, OptionalDateSchema, PaginatedResponseSchema, PaginationSchema, SemanticPropertySchema, SemanticTypeSchema, SortDirectionSchema, ThingCreateInputSchema, ThingDataSchema, ThingDeleteOptionsSchema, ThingFilterSchema, ThingPaginationSchema, ThingQueryResultSchema, ThingSchema, ThingSortSchema, ThingUpdateInputSchema, ThingVersionSchema, TokenUsageSchema, TypeStatsSchema };
|
|
261
|
+
//# sourceMappingURL=index.js.map
|
|
262
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/schemas/common.ts","../../src/schemas/thing.ts"],"names":["z"],"mappings":";;;AAqBO,IAAM,UAAA,GAAa,CAAA,CAAE,MAAA,CAAO,IAAA;AAK5B,IAAM,kBAAA,GAAqB,CAAA,CAAE,KAAA,CAAM,CAAC,UAAA,EAAY,EAAE,IAAA,EAAM,CAAC,CAAA,CAAE,QAAA;AAc3D,IAAM,qBAAA,GAAwB,EAAE,MAAA,CAAO;AAAA;AAAA,EAE5C,EAAA,EAAI,EAAE,MAAA,EAAO;AAAA;AAAA,EAEb,IAAA,EAAM,EAAE,MAAA,EAAO;AAAA;AAAA,EAEf,EAAA,EAAI,EAAE,MAAA,EAAO;AAAA;AAAA,EAEb,UAAA,EAAY,EAAE,MAAA,EAAO;AAAA;AAAA,EAErB,IAAA,EAAM,CAAA,CAAE,MAAA,EAAO,CAAE,QAAA;AACnB,CAAC;AAmBM,IAAM,gBAAA,GAAmB,EAAE,MAAA,CAAO;AAAA;AAAA,EAEvC,WAAA,EAAa,EAAE,MAAA,EAAO;AAAA;AAAA,EAEtB,YAAA,EAAc,EAAE,MAAA,EAAO;AAAA;AAAA,EAEvB,WAAA,EAAa,EAAE,MAAA,EAAO;AAAA;AAAA,EAEtB,cAAA,EAAgB,CAAA,CAAE,MAAA,EAAO,CAAE,QAAA,EAAS;AAAA;AAAA,EAEpC,OAAA,EAAS,CAAA,CAAE,MAAA,EAAO,CAAE,QAAA;AACtB,CAAC;AAmBM,IAAM,oBAAA,GAAuB,EAAE,MAAA,CAAO;AAAA;AAAA,EAE3C,IAAA,EAAM,EAAE,MAAA,EAAO;AAAA;AAAA,EAEf,OAAA,EAAS,EAAE,MAAA,EAAO;AAAA;AAAA,EAElB,KAAA,EAAO,CAAA,CAAE,MAAA,EAAO,CAAE,QAAA,EAAS;AAAA;A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,sBAAsB,CAAA;AAAA;AAAA,EAE1C,QAAA,EAAUA,CAAAA,CAAE,KAAA,CAAMA,CAAAA,CAAE,QAAQ,CAAA;AAAA;AAAA,EAE5B,QAAA,EAAUA,CAAAA,CAAE,KAAA,CAAM,eAAe,EAAE,QAAA;AACrC,CAAC;AAcM,IAAM,eAAA,GAAkBA,EAAE,MAAA,CAAO;AAAA;AAAA,EAEtC,EAAA,EAAIA,EAAE,MAAA,EAAO;AAAA;AAAA,EAEb,IAAA,EAAMA,EAAE,MAAA,EAAO;AAAA;AAAA,EAEf,WAAA,EAAaA,CAAAA,CAAE,MAAA,EAAO,CAAE,QAAA,EAAS;AAAA;AAAA,EAEjC,OAAA,EAASA,CAAAA,CAAE,MAAA,EAAO,CAAE,QAAA,EAAS;AAAA;AAAA,EAE7B,KAAA,EAAOA,CAAAA,CAAE,KAAA,CAAMA,CAAAA,CAAE,QAAQ,CAAA;AAAA;AAAA,EAEzB,UAAA,EAAYA,EAAE,MAAA,EAAO;AAAA;AAAA,EAErB,SAAA,EAAW;AACb,CAAC;AAcM,IAAM,eAAA,GAAkBA,EAAE,MAAA,CAAO;AAAA;AAAA,EAEtC,IAAA,EAAMA,EAAE,MAAA,EAAO;AAAA;AAAA,EAEf,EAAA,EAAIA,EAAE,MAAA,EAAO;AAAA;AAAA,EAEb,KAAA,EAAOA,EAAE,MAAA,EAAO;AAAA;AAAA,EAEhB,WAAA,EAAaA,EAAE,MAAA,EAAO;AAAA;AAAA,EAEtB,YAAA,EAAcA,EAAE,MAAA,EAAO;AAAA;AAAA,EAEvB,YAAA,EAAcA,EAAE,MAAA,EAAO;AAAA;AAAA,EAEvB,aAAA,EAAe,WAAW,QAAA,EAAS;AAAA;AAAA,EAEnC,aAAA,EAAe,WAAW,QAAA;AAC5B,CAAC","file":"index.js","sourcesContent":["/**\n * Common Zod Schemas - Shared Schema Definitions\n *\n * This file contains Zod schemas that are used across multiple domains.\n * Types are derived from these schemas to ensure a single source of truth.\n *\n * @remarks\n * Import schemas from here for validation.\n * Import types from here or from domain files for TypeScript types.\n */\n\nimport { z } from 'zod'\n\n// =============================================================================\n// Date Handling\n// =============================================================================\n\n/**\n * Schema for Date fields that can be either Date objects or ISO strings.\n * API responses typically return ISO strings, not Date objects.\n */\nexport const DateSchema = z.coerce.date()\n\n/**\n * Optional nullable date for responses\n */\nexport const OptionalDateSchema = z.union([DateSchema, z.null()]).optional()\n\n// =============================================================================\n// EntityReference\n// =============================================================================\n\n/**\n * Schema for EntityReference - reference to a Thing in the semantic graph.\n *\n * Used by:\n * - Relationships (subject/object in semantic triples)\n * - Events (subject/object in semantic events)\n * - Graph traversal results\n */\nexport const EntityReferenceSchema = z.object({\n /** Namespace */\n ns: z.string(),\n /** Entity type */\n type: z.string(),\n /** Entity ID */\n id: z.string(),\n /** Semantic ID (ns/type/id) */\n semanticId: z.string(),\n /** Display name (if loaded) */\n name: z.string().optional(),\n})\n\n/**\n * Reference to an entity (Thing) in the semantic graph.\n */\nexport type EntityReference = z.infer<typeof EntityReferenceSchema>\n\n// =============================================================================\n// TokenUsage\n// =============================================================================\n\n/**\n * Schema for TokenUsage - token usage metrics for AI operations.\n *\n * Used by:\n * - Agent executions\n * - Function executions (generative/agentic)\n * - Agent trace entries\n */\nexport const TokenUsageSchema = z.object({\n /** Input/prompt tokens */\n inputTokens: z.number(),\n /** Output/completion tokens */\n outputTokens: z.number(),\n /** Total tokens (input + output) */\n totalTokens: z.number(),\n /** Thinking tokens (for reasoning models like o1, Claude with thinking) */\n thinkingTokens: z.number().optional(),\n /** Estimated cost in USD */\n costUsd: z.number().optional(),\n})\n\n/**\n * Token usage metrics for AI operations.\n */\nexport type TokenUsage = z.infer<typeof TokenUsageSchema>\n\n// =============================================================================\n// ExecutionError\n// =============================================================================\n\n/**\n * Schema for ExecutionError - error information for execution failures.\n *\n * Used by:\n * - Workflow executions\n * - Function executions\n * - Step executions\n */\nexport const ExecutionErrorSchema = z.object({\n /** Error code (e.g., 'TIMEOUT', 'VALIDATION_ERROR', 'RATE_LIMITED') */\n code: z.string(),\n /** Human-readable error message */\n message: z.string(),\n /** Stack trace (for debugging) */\n stack: z.string().optional(),\n /** ID of the step that failed (for workflow executions) */\n failedStep: z.string().optional(),\n /** Number of retry attempts made (for function executions) */\n retryCount: z.number().optional(),\n /** Whether this error is retryable (for function executions) */\n retryable: z.boolean().optional(),\n})\n\n/**\n * Error information for execution failures.\n */\nexport type ExecutionError = z.infer<typeof ExecutionErrorSchema>\n\n// =============================================================================\n// SortDirection\n// =============================================================================\n\n/**\n * Schema for SortDirection - sort direction for list queries.\n */\nexport const SortDirectionSchema = z.enum(['asc', 'desc'])\n\n/**\n * Sort direction for list queries.\n */\nexport type SortDirection = z.infer<typeof SortDirectionSchema>\n\n// =============================================================================\n// Pagination Types\n// =============================================================================\n\n/**\n * Schema for Pagination - pagination input parameters for list queries.\n */\nexport const PaginationSchema = z.object({\n /** Page number (1-indexed) */\n page: z.number().int().positive(),\n /** Items per page */\n perPage: z.number().int().positive(),\n})\n\n/**\n * Pagination input parameters for list queries.\n */\nexport type Pagination = z.infer<typeof PaginationSchema>\n\n/**\n * Schema factory for paginated responses.\n */\nexport const PaginatedResponseSchema = <T extends z.ZodTypeAny>(dataSchema: T) =>\n z.object({\n /** Array of items for the current page */\n data: z.array(dataSchema),\n /** Total number of items across all pages */\n total: z.number(),\n /** Current page number (1-indexed) */\n page: z.number(),\n /** Items per page */\n perPage: z.number(),\n /** Total number of pages */\n totalPages: z.number(),\n })\n\n/**\n * Paginated response wrapper for list queries.\n */\nexport interface PaginatedResponse<T> {\n /** Array of items for the current page */\n data: T[]\n /** Total number of items across all pages */\n total: number\n /** Current page number (1-indexed) */\n page: number\n /** Items per page */\n perPage: number\n /** Total number of pages */\n totalPages: number\n}\n","/**\n * Thing Zod Schemas - Semantic Entity Management\n *\n * Things are the core entities in the .do platform, stored in the Things table\n * with ClickHouse's ReplacingMergeTree engine for immutable, versioned storage.\n *\n * All types are derived from Zod schemas to ensure a single source of truth.\n *\n * @remarks\n * Key patterns:\n * - Semantic IDs: `[namespace]/[Name]` (e.g., `schema.org/Person`)\n * - JSON-LD compatible data structure\n * - Full version history via Events table\n * - Soft deletes with deletedAt timestamp\n */\n\nimport { z } from 'zod'\nimport { DateSchema, OptionalDateSchema, SortDirectionSchema } from './common'\n\n// =============================================================================\n// ThingData Schema\n// =============================================================================\n\n/**\n * Schema for ThingData - JSON-LD compatible data structure for Things.\n */\nexport const ThingDataSchema = z\n .object({\n /** JSON-LD context */\n '@context': z.union([z.string(), z.record(z.unknown())]).optional(),\n /** JSON-LD type (should match Thing.type) */\n '@type': z.string().optional(),\n /** JSON-LD identifier */\n '@id': z.string().optional(),\n })\n .passthrough()\n\n/**\n * JSON-LD compatible data structure for Things.\n */\nexport type ThingData = z.infer<typeof ThingDataSchema>\n\n// =============================================================================\n// Thing Schema\n// =============================================================================\n\n/**\n * Schema for Thing - base Thing record from database.\n */\nexport const ThingSchema = z.object({\n /** Namespace (tenant/domain) */\n ns: z.string(),\n /** Entity type (e.g., 'Person', 'Organization', 'Agent') */\n type: z.string(),\n /** Unique identifier within namespace/type */\n id: z.string(),\n /** Version timestamp for deduplication */\n ts: DateSchema,\n /** Display name */\n name: z.string(),\n /** Creation timestamp */\n createdAt: DateSchema,\n /** Last update timestamp */\n updatedAt: DateSchema,\n /** Creator user ID */\n createdBy: z.string().optional(),\n /** Last updater user ID */\n updatedBy: z.string().optional(),\n /** Soft delete timestamp */\n deletedAt: OptionalDateSchema,\n /** A/B test variant */\n variant: z.string().optional(),\n /** JSON-LD data blob */\n data: ThingDataSchema,\n})\n\n/**\n * Base Thing record from database.\n */\nexport type Thing = z.infer<typeof ThingSchema>\n\n// =============================================================================\n// ThingFilter Schema\n// =============================================================================\n\n/**\n * Schema for ThingFilter - query filters for Things.\n */\nexport const ThingFilterSchema = z\n .object({\n /** Filter by namespace - single string or array of strings */\n ns: z.union([z.string(), z.array(z.string())]).optional(),\n /** Filter by type - single string or array of strings */\n type: z.union([z.string(), z.array(z.string())]).optional(),\n /** Filter by ID pattern (supports wildcards) */\n idPattern: z.string().optional(),\n /** Filter by name (case-insensitive search) */\n nameSearch: z.string().optional(),\n /** Filter by creation date range - start */\n createdAfter: z.coerce.date().optional(),\n /** Filter by creation date range - end */\n createdBefore: z.coerce.date().optional(),\n /** Filter by update date range - start */\n updatedAfter: z.coerce.date().optional(),\n /** Filter by update date range - end */\n updatedBefore: z.coerce.date().optional(),\n /** Include soft-deleted things */\n includeDeleted: z.boolean().optional(),\n /** Filter by specific property values in data */\n properties: z.record(z.unknown()).optional(),\n /** Filter by variant */\n variant: z.string().optional(),\n })\n .passthrough()\n\n/**\n * Query filters for Things.\n */\nexport type ThingFilter = z.infer<typeof ThingFilterSchema>\n\n// =============================================================================\n// ThingSort Schema\n// =============================================================================\n\n/**\n * Schema for ThingSort - sort options for Things.\n */\nexport const ThingSortSchema = z.object({\n /** Field to sort by */\n field: z.enum(['name', 'createdAt', 'updatedAt', 'ts', 'type']),\n /** Sort direction */\n order: SortDirectionSchema,\n})\n\n/**\n * Sort options for Things.\n */\nexport type ThingSort = z.infer<typeof ThingSortSchema>\n\n// =============================================================================\n// ThingPagination Schema\n// =============================================================================\n\n/**\n * Schema for ThingPagination - pagination for Things queries.\n */\nexport const ThingPaginationSchema = z.object({\n /** Page number (1-indexed, must be positive) */\n page: z.number().int().positive(),\n /** Items per page (must be positive, max 1000) */\n perPage: z.number().int().positive().max(1000),\n})\n\n/**\n * Pagination for Things queries.\n */\nexport type ThingPagination = z.infer<typeof ThingPaginationSchema>\n\n// =============================================================================\n// ThingQueryResult Schema\n// =============================================================================\n\n/**\n * Schema for ThingQueryResult - result of a Things query.\n */\nexport const ThingQueryResultSchema = z.object({\n /** Matching things */\n data: z.array(ThingSchema),\n /** Total count (without pagination) */\n total: z.number(),\n /** Current page */\n page: z.number(),\n /** Items per page */\n perPage: z.number(),\n /** Total pages */\n totalPages: z.number(),\n})\n\n/**\n * Result of a Things query.\n */\nexport type ThingQueryResult = z.infer<typeof ThingQueryResultSchema>\n\n// =============================================================================\n// ThingCreateInput Schema\n// =============================================================================\n\n/**\n * Schema for ThingCreateInput - thing creation payload.\n */\nexport const ThingCreateInputSchema = z.object({\n /** Namespace (required, non-empty string) */\n ns: z.string().min(1, 'Namespace is required'),\n /** Type (required, non-empty string) */\n type: z.string().min(1, 'Type is required'),\n /** ID (optional, auto-generated if not provided) */\n id: z.string().optional(),\n /** Display name (required, non-empty string) */\n name: z.string().min(1, 'Name is required'),\n /** JSON-LD data */\n data: ThingDataSchema,\n /** Variant for A/B testing */\n variant: z.string().optional(),\n})\n\n/**\n * Thing creation payload.\n */\nexport type ThingCreateInput = z.infer<typeof ThingCreateInputSchema>\n\n// =============================================================================\n// ThingUpdateInput Schema\n// =============================================================================\n\n/**\n * Schema for ThingUpdateInput - thing update payload.\n */\nexport const ThingUpdateInputSchema = z.object({\n /** Updated name */\n name: z.string().min(1, 'Name cannot be empty').optional(),\n /** Updated data (merged with existing) */\n data: ThingDataSchema.partial().optional(),\n /** Updated variant */\n variant: z.string().optional(),\n})\n\n/**\n * Thing update payload.\n */\nexport type ThingUpdateInput = z.infer<typeof ThingUpdateInputSchema>\n\n// =============================================================================\n// ThingDeleteOptions Schema\n// =============================================================================\n\n/**\n * Schema for ThingDeleteOptions - delete options.\n */\nexport const ThingDeleteOptionsSchema = z.object({\n /** Hard delete (permanent) vs soft delete */\n hard: z.boolean().optional(),\n})\n\n/**\n * Thing delete options.\n */\nexport type ThingDeleteOptions = z.infer<typeof ThingDeleteOptionsSchema>\n\n// =============================================================================\n// ThingVersion Schema\n// =============================================================================\n\n/**\n * Schema for ThingVersion - thing version from Events table.\n */\nexport const ThingVersionSchema = z.object({\n /** Event ID */\n eventId: z.string(),\n /** Event type (create, update, delete) */\n eventType: z.enum(['create', 'update', 'delete', 'create_version', 'update_version']),\n /** Version timestamp */\n ts: DateSchema,\n /** User who made the change */\n userId: z.string(),\n /** Full data snapshot at this version */\n data: ThingDataSchema,\n /** Delta from previous version */\n delta: ThingDataSchema.optional(),\n /** Event metadata */\n metadata: z.record(z.unknown()),\n})\n\n/**\n * Thing version from Events table.\n */\nexport type ThingVersion = z.infer<typeof ThingVersionSchema>\n\n// =============================================================================\n// SemanticProperty Schema\n// =============================================================================\n\n/**\n * Schema for SemanticProperty - property definition for semantic types.\n */\nexport const SemanticPropertySchema = z.object({\n /** Property name */\n name: z.string(),\n /** Property label */\n label: z.string(),\n /** Property description */\n description: z.string(),\n /** Expected value types */\n rangeIncludes: z.array(z.string()),\n /** Types that use this property */\n domainIncludes: z.array(z.string()),\n /** Is this property required? */\n required: z.boolean(),\n /** Is this property an array? */\n isArray: z.boolean(),\n /** Default value */\n defaultValue: z.unknown().optional(),\n})\n\n/**\n * Property definition for semantic types.\n */\nexport type SemanticProperty = z.infer<typeof SemanticPropertySchema>\n\n// =============================================================================\n// SemanticType Schema\n// =============================================================================\n\n/**\n * Schema for SemanticType - semantic type definition (like schema.org types).\n */\nexport const SemanticTypeSchema = z.object({\n /** Type namespace (e.g., 'schema.org') */\n namespace: z.string(),\n /** Type name (e.g., 'Person') */\n name: z.string(),\n /** Full semantic ID */\n id: z.string(),\n /** Human-readable label */\n label: z.string(),\n /** Type description */\n description: z.string(),\n /** Parent types (inheritance) */\n parentTypes: z.array(z.string()),\n /** Properties defined by this type */\n properties: z.array(SemanticPropertySchema),\n /** Child types */\n subtypes: z.array(z.string()),\n /** Example instances */\n examples: z.array(ThingDataSchema).optional(),\n})\n\n/**\n * Semantic type definition (like schema.org types).\n */\nexport type SemanticType = z.infer<typeof SemanticTypeSchema>\n\n// =============================================================================\n// Namespace Schema\n// =============================================================================\n\n/**\n * Schema for Namespace - namespace definition (tenant/domain).\n */\nexport const NamespaceSchema = z.object({\n /** Namespace identifier */\n id: z.string(),\n /** Namespace name */\n name: z.string(),\n /** Namespace description */\n description: z.string().optional(),\n /** Base URL for the namespace */\n baseUrl: z.string().optional(),\n /** Available types in this namespace */\n types: z.array(z.string()),\n /** Thing count in this namespace */\n thingCount: z.number(),\n /** Creation timestamp */\n createdAt: DateSchema,\n})\n\n/**\n * Namespace definition (tenant/domain).\n */\nexport type Namespace = z.infer<typeof NamespaceSchema>\n\n// =============================================================================\n// TypeStats Schema\n// =============================================================================\n\n/**\n * Schema for TypeStats - statistics for a type.\n */\nexport const TypeStatsSchema = z.object({\n /** Type name */\n type: z.string(),\n /** Namespace */\n ns: z.string(),\n /** Total count */\n count: z.number(),\n /** Active count (not deleted) */\n activeCount: z.number(),\n /** Created today */\n createdToday: z.number(),\n /** Updated today */\n updatedToday: z.number(),\n /** Most recent creation */\n lastCreatedAt: DateSchema.optional(),\n /** Most recent update */\n lastUpdatedAt: DateSchema.optional(),\n})\n\n/**\n * Statistics for a type.\n */\nexport type TypeStats = z.infer<typeof TypeStatsSchema>\n"]}
|