@mdxui/do 2.1.1 → 4.0.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.
Files changed (75) hide show
  1. package/README.md +115 -323
  2. package/dist/{agents-xcIn2dUB.d.ts → agents-2_r9e9i7.d.ts} +213 -2
  3. package/dist/app/index.d.ts +347 -0
  4. package/dist/app/index.js +14 -0
  5. package/dist/app/index.js.map +1 -0
  6. package/dist/breadcrumbs-C9Qn3S7d.d.ts +81 -0
  7. package/dist/capnweb-client-Bq78FtEA.d.ts +229 -0
  8. package/dist/chunk-3XKYQRXY.js +192 -0
  9. package/dist/chunk-3XKYQRXY.js.map +1 -0
  10. package/dist/chunk-4KXVN3EQ.js +56 -0
  11. package/dist/chunk-4KXVN3EQ.js.map +1 -0
  12. package/dist/chunk-5SHZZC7L.js +234 -0
  13. package/dist/chunk-5SHZZC7L.js.map +1 -0
  14. package/dist/chunk-7UFINK3Q.js +1994 -0
  15. package/dist/chunk-7UFINK3Q.js.map +1 -0
  16. package/dist/chunk-JJLAES6W.js +76 -0
  17. package/dist/chunk-JJLAES6W.js.map +1 -0
  18. package/dist/chunk-KT52UU3U.js +985 -0
  19. package/dist/chunk-KT52UU3U.js.map +1 -0
  20. package/dist/chunk-LJIWB7KE.js +95 -0
  21. package/dist/chunk-LJIWB7KE.js.map +1 -0
  22. package/dist/chunk-NA652ART.js +596 -0
  23. package/dist/chunk-NA652ART.js.map +1 -0
  24. package/dist/chunk-OVLO7UOH.js +1071 -0
  25. package/dist/chunk-OVLO7UOH.js.map +1 -0
  26. package/dist/chunk-VRLUXCLD.js +31 -0
  27. package/dist/chunk-VRLUXCLD.js.map +1 -0
  28. package/dist/chunk-WMNT4OIE.js +249 -0
  29. package/dist/chunk-WMNT4OIE.js.map +1 -0
  30. package/dist/chunk-Y52IEYVM.js +131 -0
  31. package/dist/chunk-Y52IEYVM.js.map +1 -0
  32. package/dist/components/index.d.ts +14 -732
  33. package/dist/components/index.js +3 -6
  34. package/dist/config-CxvpD8Y6.d.ts +111 -0
  35. package/dist/{do-CaQVueZw.d.ts → do-D27i5bU0.d.ts} +32 -33
  36. package/dist/errors-DratdVIz.d.ts +346 -0
  37. package/dist/hooks/index.d.ts +450 -691
  38. package/dist/hooks/index.js +6 -4
  39. package/dist/hooks/things/index.d.ts +298 -0
  40. package/dist/hooks/things/index.js +8 -0
  41. package/dist/hooks/things/index.js.map +1 -0
  42. package/dist/index.d.ts +62 -989
  43. package/dist/index.js +12 -839
  44. package/dist/index.js.map +1 -1
  45. package/dist/lib/index.d.ts +798 -0
  46. package/dist/lib/index.js +6 -0
  47. package/dist/lib/index.js.map +1 -0
  48. package/dist/providers/index.d.ts +130 -34
  49. package/dist/providers/index.js +3 -2
  50. package/dist/query-keys-CZNFikIi.d.ts +153 -0
  51. package/dist/schemas/index.d.ts +5 -5
  52. package/dist/schemas/index.js +2 -2
  53. package/dist/schemas/index.js.map +1 -1
  54. package/dist/{thing-DtI25yZh.d.ts → thing-BF25aUtJ.d.ts} +72 -72
  55. package/dist/types/index.d.ts +693 -658
  56. package/dist/types/index.js +1 -2
  57. package/dist/views/index.d.ts +131 -0
  58. package/dist/views/index.js +11 -0
  59. package/dist/views/index.js.map +1 -0
  60. package/package.json +39 -17
  61. package/dist/__test-utils__/index.d.ts +0 -399
  62. package/dist/__test-utils__/index.js +0 -34641
  63. package/dist/__test-utils__/index.js.map +0 -1
  64. package/dist/chunk-EEDMN7UF.js +0 -1351
  65. package/dist/chunk-EEDMN7UF.js.map +0 -1
  66. package/dist/chunk-G3PMV62Z.js +0 -33
  67. package/dist/chunk-G3PMV62Z.js.map +0 -1
  68. package/dist/chunk-NXPXL5NA.js +0 -3789
  69. package/dist/chunk-NXPXL5NA.js.map +0 -1
  70. package/dist/chunk-PC5FJY6M.js +0 -20
  71. package/dist/chunk-PC5FJY6M.js.map +0 -1
  72. package/dist/chunk-XF6LKY2M.js +0 -445
  73. package/dist/chunk-XF6LKY2M.js.map +0 -1
  74. package/dist/magic-string.es-J7BYFTTJ.js +0 -1307
  75. package/dist/magic-string.es-J7BYFTTJ.js.map +0 -1
@@ -1,7 +1,9 @@
1
- export { AdminError, AdminProvider, DO, AdminProvider2 as DotdoAdminProvider, DotdoDataProvider, agentsKeys, createCacheKey, createResourceFromSchema, formatAdminError, inferFieldsFromSchema, invalidateCache, isAdminError, relationshipsKeys, thingsKeys, use$, useAdminContext, useAgent, useAgentExecution, useAgentExecutions, useAgentMetrics, useAgents, useCancelExecution, useCreateAgent, useCreateRelationship, useCreateThing, useCreateWorkflow, useDOAdmin, useDOContext, useDOResource, useDeleteAgent, useDeleteRelationship, useDeleteThing, useDeleteWorkflow, useEntityRelationships, useExecuteAgent, useGraphStats, useGraphTraversal, useIsDOEnabled, useOptimisticUpdate, useRelationships, useSubmitAgentFeedback, useThing, useThingVersions, useThings, useTriggerWorkflow, useTypeStats, useUpdateAgent, useUpdateThing, useUpdateWorkflow, useWorkflow, useWorkflowExecution, useWorkflowExecutions, useWorkflows, workflowsKeys } from '../chunk-EEDMN7UF.js';
2
- import '../chunk-GKSP5RIA.js';
1
+ export { namespacesKeys, schemaKeys, typesKeys, useBreadcrumbs, useEditHistory, useKeyboardShortcuts, useNamespaces, useSchema, useSchemaDefinition, useSingleThingSubscription, useThingSubscription, useTypes } from '../chunk-NA652ART.js';
2
+ export { useCreateThing, useDeleteThing, useThing, useThingVersions, useThings, useTypeStats, useUpdateThing } from '../chunk-5SHZZC7L.js';
3
+ export { thingsKeys } from '../chunk-4KXVN3EQ.js';
4
+ import '../chunk-WMNT4OIE.js';
5
+ import '../chunk-OVLO7UOH.js';
6
+ import '../chunk-Y52IEYVM.js';
3
7
  import '../chunk-GGO5GW72.js';
4
- import '../chunk-XF6LKY2M.js';
5
- import '../chunk-G3PMV62Z.js';
6
8
  //# sourceMappingURL=index.js.map
7
9
  //# sourceMappingURL=index.js.map
@@ -0,0 +1,298 @@
1
+ import { f as ThingQueryResult, T as Thing, j as ThingVersion, k as TypeStats, g as ThingCreateInput, h as ThingUpdateInput, c as ThingFilter, d as ThingSort, e as ThingPagination } from '../../thing-BF25aUtJ.js';
2
+ import { QueryObserverResult } from '@tanstack/react-query';
3
+ export { t as thingsKeys } from '../../query-keys-CZNFikIi.js';
4
+ import 'zod';
5
+ import '../../schemas/index.js';
6
+ import '../../agents-2_r9e9i7.js';
7
+
8
+ /**
9
+ * Type definitions for Things hooks
10
+ *
11
+ * Provides return types for query and mutation hooks.
12
+ */
13
+
14
+ /**
15
+ * Parameters for useThing, useThingVersions hooks
16
+ *
17
+ * The object-based API provides better DX with named parameters.
18
+ *
19
+ * @example
20
+ * ```tsx
21
+ * // Object-based (preferred)
22
+ * const { data } = useThing({ ns: 'default', type: 'Task', id: 'task-123' })
23
+ * ```
24
+ */
25
+ interface ThingParams {
26
+ /** Namespace identifier */
27
+ ns: string;
28
+ /** Thing type (e.g., 'Task', 'User') */
29
+ type: string;
30
+ /** Thing ID */
31
+ id: string;
32
+ }
33
+ /**
34
+ * Parameters for useTypeStats hook
35
+ *
36
+ * @example
37
+ * ```tsx
38
+ * // Object-based (preferred)
39
+ * const { data } = useTypeStats({ ns: 'default', type: 'Task' })
40
+ * ```
41
+ */
42
+ interface TypeStatsParams {
43
+ /** Namespace identifier */
44
+ ns: string;
45
+ /** Thing type (e.g., 'Task', 'User') */
46
+ type: string;
47
+ }
48
+ /**
49
+ * Return type for useThings hook
50
+ */
51
+ interface UseThingsResult {
52
+ /** The query result data, or null if not yet loaded */
53
+ data: ThingQueryResult | null;
54
+ /** True during initial load */
55
+ isLoading: boolean;
56
+ /** Error from the query, or null */
57
+ error: Error | null;
58
+ /** Function to manually refetch the data */
59
+ refetch: () => Promise<QueryObserverResult<ThingQueryResult, Error>>;
60
+ /** The query key used for cache management */
61
+ queryKey: readonly unknown[];
62
+ /** True if refetching in the background */
63
+ isRefetching: boolean;
64
+ /** True if any fetch is in progress */
65
+ isFetching: boolean;
66
+ /** Query status: 'pending', 'success', or 'error' */
67
+ status: 'pending' | 'success' | 'error';
68
+ }
69
+ /**
70
+ * Return type for useThing hook
71
+ */
72
+ interface UseThingResult {
73
+ /** The Thing data, or null if not yet loaded */
74
+ data: Thing | null;
75
+ /** True during initial load */
76
+ isLoading: boolean;
77
+ /** Error from the query, or null */
78
+ error: Error | null;
79
+ /** Function to manually refetch the data */
80
+ refetch: () => Promise<QueryObserverResult<Thing, Error>>;
81
+ /** The query key used for cache management */
82
+ queryKey: readonly unknown[];
83
+ /** True if refetching in the background */
84
+ isRefetching: boolean;
85
+ /** True if any fetch is in progress */
86
+ isFetching: boolean;
87
+ /** Query status: 'pending', 'success', or 'error' */
88
+ status: 'pending' | 'success' | 'error';
89
+ }
90
+ /**
91
+ * Return type for useThingVersions hook
92
+ */
93
+ interface UseThingVersionsResult {
94
+ /** The versions array, or null if not yet loaded */
95
+ data: ThingVersion[] | null;
96
+ /** True during initial load */
97
+ isLoading: boolean;
98
+ /** Error from the query, or null */
99
+ error: Error | null;
100
+ /** Function to manually refetch the data */
101
+ refetch: () => Promise<QueryObserverResult<ThingVersion[], Error>>;
102
+ /** The query key used for cache management */
103
+ queryKey: readonly unknown[];
104
+ /** True if refetching in the background */
105
+ isRefetching: boolean;
106
+ /** True if any fetch is in progress */
107
+ isFetching: boolean;
108
+ /** Query status: 'pending', 'success', or 'error' */
109
+ status: 'pending' | 'success' | 'error';
110
+ }
111
+ /**
112
+ * Return type for useTypeStats hook
113
+ */
114
+ interface UseTypeStatsResult {
115
+ /** The type statistics, or null if not yet loaded */
116
+ data: TypeStats | null;
117
+ /** True during initial load */
118
+ isLoading: boolean;
119
+ /** Error from the query, or null */
120
+ error: Error | null;
121
+ /** Function to manually refetch the data */
122
+ refetch: () => Promise<QueryObserverResult<TypeStats, Error>>;
123
+ /** The query key used for cache management */
124
+ queryKey: readonly unknown[];
125
+ /** True if refetching in the background */
126
+ isRefetching: boolean;
127
+ /** True if any fetch is in progress */
128
+ isFetching: boolean;
129
+ /** Query status: 'pending', 'success', or 'error' */
130
+ status: 'pending' | 'success' | 'error';
131
+ }
132
+ /**
133
+ * Return type for useCreateThing hook
134
+ */
135
+ interface UseCreateThingResult {
136
+ /** Trigger the mutation */
137
+ mutate: (input: ThingCreateInput) => void;
138
+ /** Trigger the mutation and return a promise */
139
+ mutateAsync: (input: ThingCreateInput) => Promise<Thing>;
140
+ /** True while mutation is in progress */
141
+ isLoading: boolean;
142
+ /** Error from the mutation, or null */
143
+ error: Error | null;
144
+ /** True if the mutation succeeded */
145
+ isSuccess: boolean;
146
+ /** Reset the mutation state */
147
+ reset: () => void;
148
+ }
149
+ /**
150
+ * Return type for useUpdateThing hook
151
+ */
152
+ interface UseUpdateThingResult {
153
+ /** Trigger the mutation */
154
+ mutate: (input: ThingUpdateInput) => void;
155
+ /** Trigger the mutation and return a promise */
156
+ mutateAsync: (input: ThingUpdateInput) => Promise<Thing>;
157
+ /** True while mutation is in progress */
158
+ isLoading: boolean;
159
+ /** Error from the mutation, or null */
160
+ error: Error | null;
161
+ /** True if the mutation succeeded */
162
+ isSuccess: boolean;
163
+ /** Reset the mutation state */
164
+ reset: () => void;
165
+ }
166
+ /**
167
+ * Options for delete operation
168
+ */
169
+ interface DeleteThingOptions {
170
+ /** If true, permanently delete instead of soft delete */
171
+ hard?: boolean;
172
+ }
173
+ /**
174
+ * Return type for useDeleteThing hook
175
+ */
176
+ interface UseDeleteThingResult {
177
+ /** Trigger the mutation */
178
+ mutate: (options?: DeleteThingOptions) => void;
179
+ /** Trigger the mutation and return a promise */
180
+ mutateAsync: (options?: DeleteThingOptions) => Promise<void>;
181
+ /** True while mutation is in progress */
182
+ isLoading: boolean;
183
+ /** Error from the mutation, or null */
184
+ error: Error | null;
185
+ /** True if the mutation succeeded */
186
+ isSuccess: boolean;
187
+ /** Reset the mutation state */
188
+ reset: () => void;
189
+ }
190
+
191
+ /**
192
+ * Hook to fetch a list of Things
193
+ *
194
+ * Uses React Query for caching with @dotdo/client RPC for data fetching.
195
+ */
196
+ declare function useThings(filter?: ThingFilter, sort?: ThingSort, pagination?: ThingPagination): UseThingsResult;
197
+ /**
198
+ * Hook to fetch a single Thing
199
+ *
200
+ * Uses React Query for caching with @dotdo/client RPC calls.
201
+ *
202
+ * @example Object-based API (preferred)
203
+ * ```tsx
204
+ * const { data } = useThing({ ns: 'default', type: 'Task', id: 'task-123' })
205
+ * ```
206
+ *
207
+ * @example Positional API (deprecated)
208
+ * ```tsx
209
+ * const { data } = useThing('default', 'Task', 'task-123')
210
+ * ```
211
+ */
212
+ declare function useThing(params: ThingParams): UseThingResult;
213
+ /**
214
+ * @deprecated Use object-based API: `useThing({ ns, type, id })` instead
215
+ */
216
+ declare function useThing(ns: string, type: string, id: string): UseThingResult;
217
+ /**
218
+ * Hook to fetch Thing version history
219
+ *
220
+ * @example Object-based API (preferred)
221
+ * ```tsx
222
+ * const { data } = useThingVersions({ ns: 'default', type: 'Task', id: 'task-123' })
223
+ * ```
224
+ *
225
+ * @example Positional API (deprecated)
226
+ * ```tsx
227
+ * const { data } = useThingVersions('default', 'Task', 'task-123')
228
+ * ```
229
+ */
230
+ declare function useThingVersions(params: ThingParams): UseThingVersionsResult;
231
+ /**
232
+ * @deprecated Use object-based API: `useThingVersions({ ns, type, id })` instead
233
+ */
234
+ declare function useThingVersions(ns: string, type: string, id: string): UseThingVersionsResult;
235
+ /**
236
+ * Hook to fetch type statistics
237
+ *
238
+ * @example Object-based API (preferred)
239
+ * ```tsx
240
+ * const { data } = useTypeStats({ ns: 'default', type: 'Task' })
241
+ * ```
242
+ *
243
+ * @example Positional API (deprecated)
244
+ * ```tsx
245
+ * const { data } = useTypeStats('default', 'Task')
246
+ * ```
247
+ */
248
+ declare function useTypeStats(params: TypeStatsParams): UseTypeStatsResult;
249
+ /**
250
+ * @deprecated Use object-based API: `useTypeStats({ ns, type })` instead
251
+ */
252
+ declare function useTypeStats(ns: string, type: string): UseTypeStatsResult;
253
+
254
+ /**
255
+ * Hook to create a Thing
256
+ *
257
+ * Automatically invalidates the things list cache on success.
258
+ *
259
+ * Supports two modes:
260
+ * 1. **DataProvider mode**: Uses DataProvider.create() when available (via DoDataProviderProvider)
261
+ * 2. **RPC mode**: Uses @dotdo/client for backend communication
262
+ */
263
+ declare function useCreateThing(): UseCreateThingResult;
264
+ /**
265
+ * Hook to update a Thing
266
+ *
267
+ * Automatically invalidates the related cache entries on success.
268
+ *
269
+ * @example Object-based API (preferred)
270
+ * ```tsx
271
+ * const updateThing = useUpdateThing({ ns: 'default', type: 'Task', id: 'task-123' })
272
+ * updateThing.mutate({ name: 'Updated Task' })
273
+ * ```
274
+ */
275
+ declare function useUpdateThing(params: ThingParams): UseUpdateThingResult;
276
+ /**
277
+ * @deprecated Use object-based API: `useUpdateThing({ ns, type, id })` instead
278
+ */
279
+ declare function useUpdateThing(ns: string, type: string, id: string): UseUpdateThingResult;
280
+ /**
281
+ * Hook to delete a Thing (soft delete by default)
282
+ *
283
+ * Automatically invalidates the related cache entries on success.
284
+ *
285
+ * @example Object-based API (preferred)
286
+ * ```tsx
287
+ * const deleteThing = useDeleteThing({ ns: 'default', type: 'Task', id: 'task-123' })
288
+ * deleteThing.mutate() // soft delete
289
+ * deleteThing.mutate({ hard: true }) // hard delete
290
+ * ```
291
+ */
292
+ declare function useDeleteThing(params: ThingParams): UseDeleteThingResult;
293
+ /**
294
+ * @deprecated Use object-based API: `useDeleteThing({ ns, type, id })` instead
295
+ */
296
+ declare function useDeleteThing(ns: string, type: string, id: string): UseDeleteThingResult;
297
+
298
+ export { type DeleteThingOptions, type ThingParams, type TypeStatsParams, type UseCreateThingResult, type UseDeleteThingResult, type UseThingResult, type UseThingVersionsResult, type UseThingsResult, type UseTypeStatsResult, type UseUpdateThingResult, useCreateThing, useDeleteThing, useThing, useThingVersions, useThings, useTypeStats, useUpdateThing };
@@ -0,0 +1,8 @@
1
+ export { useCreateThing, useDeleteThing, useThing, useThingVersions, useThings, useTypeStats, useUpdateThing } from '../../chunk-5SHZZC7L.js';
2
+ export { thingsKeys } from '../../chunk-4KXVN3EQ.js';
3
+ import '../../chunk-WMNT4OIE.js';
4
+ import '../../chunk-OVLO7UOH.js';
5
+ import '../../chunk-Y52IEYVM.js';
6
+ import '../../chunk-GGO5GW72.js';
7
+ //# sourceMappingURL=index.js.map
8
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":[],"names":[],"mappings":"","file":"index.js"}