@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,8 @@
|
|
|
1
|
+
export { AgentExecutePanel, AgentFeedbackPanel, AgentHistoryTable, AgentsGrid, ConfirmDialog, DOErrorBoundary, DOHeader, DOShell, DOSidebar, DOSidebarHeader, StatsCards, SyncStatusIndicator, ThingForm, ThingFormDialog, ThingsList, ThingsPage, ToastContainer, ToastProvider, TriggerWorkflowDialog, WorkflowExecutionView, WorkflowsList, defaultNavItems, defaultStats, useErrorBoundary, useShell, useToast } from '../chunk-NXPXL5NA.js';
|
|
2
|
+
import '../chunk-EEDMN7UF.js';
|
|
3
|
+
import '../chunk-GKSP5RIA.js';
|
|
4
|
+
import '../chunk-GGO5GW72.js';
|
|
5
|
+
import '../chunk-XF6LKY2M.js';
|
|
6
|
+
import '../chunk-G3PMV62Z.js';
|
|
7
|
+
//# sourceMappingURL=index.js.map
|
|
8
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":[],"names":[],"mappings":"","file":"index.js"}
|
|
@@ -0,0 +1,195 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Durable Object Management Types
|
|
5
|
+
*
|
|
6
|
+
* Core types for managing Cloudflare Durable Objects infrastructure.
|
|
7
|
+
* DOs provide strongly consistent, single-threaded state management.
|
|
8
|
+
*
|
|
9
|
+
* @remarks
|
|
10
|
+
* The DO system uses:
|
|
11
|
+
* - ctx.storage.put/get/delete for persistence
|
|
12
|
+
* - blockConcurrencyWhile() for atomic operations
|
|
13
|
+
* - alarms for scheduled events
|
|
14
|
+
* - RPC via fetch for inter-DO communication
|
|
15
|
+
*/
|
|
16
|
+
|
|
17
|
+
/**
|
|
18
|
+
* Status of a Durable Object instance
|
|
19
|
+
*/
|
|
20
|
+
type DOStatus = 'active' | 'hibernating' | 'initializing' | 'error';
|
|
21
|
+
/**
|
|
22
|
+
* Durable Object class types available in the platform
|
|
23
|
+
*/
|
|
24
|
+
type DOClassType = 'ClaudeCodeSession' | 'StateMachine' | 'ThingsRelationshipsDO' | 'BrowserSession' | 'ChangeProposal' | 'ConversationSession' | 'Custom';
|
|
25
|
+
/**
|
|
26
|
+
* Durable Object instance information
|
|
27
|
+
*/
|
|
28
|
+
interface DOInstance {
|
|
29
|
+
/** Unique identifier for the DO instance */
|
|
30
|
+
id: string;
|
|
31
|
+
/** Human-readable name derived from idFromName() */
|
|
32
|
+
name: string;
|
|
33
|
+
/** DO class type */
|
|
34
|
+
classType: DOClassType;
|
|
35
|
+
/** Current status */
|
|
36
|
+
status: DOStatus;
|
|
37
|
+
/** Namespace/tenant this DO belongs to */
|
|
38
|
+
namespace: string;
|
|
39
|
+
/** When the DO was created */
|
|
40
|
+
createdAt: Date;
|
|
41
|
+
/** Last activity timestamp */
|
|
42
|
+
lastActiveAt: Date;
|
|
43
|
+
/** Storage size in bytes */
|
|
44
|
+
storageBytes: number;
|
|
45
|
+
/** Number of stored keys */
|
|
46
|
+
keyCount: number;
|
|
47
|
+
/** Pending alarms */
|
|
48
|
+
alarms: DOAlarm[];
|
|
49
|
+
/** Custom metadata */
|
|
50
|
+
metadata: Record<string, unknown>;
|
|
51
|
+
}
|
|
52
|
+
/**
|
|
53
|
+
* Scheduled alarm for a Durable Object
|
|
54
|
+
*/
|
|
55
|
+
interface DOAlarm {
|
|
56
|
+
/** Scheduled execution time */
|
|
57
|
+
scheduledAt: Date;
|
|
58
|
+
/** Event type to execute */
|
|
59
|
+
eventType: string;
|
|
60
|
+
/** Event payload */
|
|
61
|
+
payload?: Record<string, unknown>;
|
|
62
|
+
}
|
|
63
|
+
/**
|
|
64
|
+
* DO storage key-value pair
|
|
65
|
+
*/
|
|
66
|
+
interface DOStorageEntry {
|
|
67
|
+
/** Storage key */
|
|
68
|
+
key: string;
|
|
69
|
+
/** Stored value (JSON-serialized) */
|
|
70
|
+
value: unknown;
|
|
71
|
+
/** Value type */
|
|
72
|
+
type: 'string' | 'number' | 'boolean' | 'object' | 'array' | 'null';
|
|
73
|
+
/** Size in bytes */
|
|
74
|
+
size: number;
|
|
75
|
+
}
|
|
76
|
+
/**
|
|
77
|
+
* DO namespace binding configuration
|
|
78
|
+
*/
|
|
79
|
+
interface DOBinding {
|
|
80
|
+
/** Binding name in worker env */
|
|
81
|
+
name: string;
|
|
82
|
+
/** DO class name */
|
|
83
|
+
className: string;
|
|
84
|
+
/** Worker script containing the DO */
|
|
85
|
+
scriptName?: string;
|
|
86
|
+
/** Environment (production/staging/development) */
|
|
87
|
+
environment?: string;
|
|
88
|
+
}
|
|
89
|
+
/**
|
|
90
|
+
* RPC method definition for DO
|
|
91
|
+
*/
|
|
92
|
+
interface DORPCMethod {
|
|
93
|
+
/** Method name */
|
|
94
|
+
name: string;
|
|
95
|
+
/** Method description */
|
|
96
|
+
description: string;
|
|
97
|
+
/** Parameter schema */
|
|
98
|
+
parameters: z.ZodSchema;
|
|
99
|
+
/** Return type schema */
|
|
100
|
+
returns: z.ZodSchema;
|
|
101
|
+
}
|
|
102
|
+
/**
|
|
103
|
+
* DO health check result
|
|
104
|
+
*/
|
|
105
|
+
interface DOHealthCheck {
|
|
106
|
+
/** DO instance ID */
|
|
107
|
+
instanceId: string;
|
|
108
|
+
/** Health status */
|
|
109
|
+
healthy: boolean;
|
|
110
|
+
/** Response time in ms */
|
|
111
|
+
responseTimeMs: number;
|
|
112
|
+
/** Error message if unhealthy */
|
|
113
|
+
error?: string;
|
|
114
|
+
/** Timestamp of check */
|
|
115
|
+
checkedAt: Date;
|
|
116
|
+
}
|
|
117
|
+
/**
|
|
118
|
+
* DO metrics for monitoring
|
|
119
|
+
*/
|
|
120
|
+
interface DOMetrics {
|
|
121
|
+
/** DO instance ID */
|
|
122
|
+
instanceId: string;
|
|
123
|
+
/** Period start */
|
|
124
|
+
periodStart: Date;
|
|
125
|
+
/** Period end */
|
|
126
|
+
periodEnd: Date;
|
|
127
|
+
/** Total requests handled */
|
|
128
|
+
totalRequests: number;
|
|
129
|
+
/** Failed requests */
|
|
130
|
+
failedRequests: number;
|
|
131
|
+
/** Average response time in ms */
|
|
132
|
+
avgResponseTimeMs: number;
|
|
133
|
+
/** P99 response time in ms */
|
|
134
|
+
p99ResponseTimeMs: number;
|
|
135
|
+
/** Storage operations count */
|
|
136
|
+
storageOperations: number;
|
|
137
|
+
/** Alarms triggered */
|
|
138
|
+
alarmsTriggered: number;
|
|
139
|
+
}
|
|
140
|
+
/**
|
|
141
|
+
* Conflict resolution strategy for sync
|
|
142
|
+
*/
|
|
143
|
+
type ConflictStrategy = 'last-write-wins' | 'merge' | ConflictResolver;
|
|
144
|
+
type ConflictResolver = <T>(local: T, remote: T, base?: T) => T;
|
|
145
|
+
/**
|
|
146
|
+
* Offline persistence configuration
|
|
147
|
+
*/
|
|
148
|
+
interface OfflineConfig {
|
|
149
|
+
/** Enable IndexedDB persistence */
|
|
150
|
+
enabled: boolean;
|
|
151
|
+
/** IndexedDB database name */
|
|
152
|
+
dbName?: string;
|
|
153
|
+
}
|
|
154
|
+
/**
|
|
155
|
+
* Sync status for DO connection
|
|
156
|
+
*/
|
|
157
|
+
type SyncStatus = 'disconnected' | 'connecting' | 'syncing' | 'synced' | 'error';
|
|
158
|
+
/**
|
|
159
|
+
* Configuration for DO admin interface
|
|
160
|
+
*
|
|
161
|
+
* Supports two modes:
|
|
162
|
+
* - REST API mode: Traditional fetch-based API calls
|
|
163
|
+
* - TanStack DB mode: Reactive local-first with WebSocket sync
|
|
164
|
+
*/
|
|
165
|
+
interface DOAdminConfig {
|
|
166
|
+
/** API endpoint for DO management (REST mode) */
|
|
167
|
+
apiEndpoint: string;
|
|
168
|
+
/** WebSocket URL for Durable Object sync (TanStack DB mode) */
|
|
169
|
+
doUrl?: string;
|
|
170
|
+
/** Authentication method */
|
|
171
|
+
authMethod: 'jwt' | 'api-key' | 'oauth';
|
|
172
|
+
/** Auth token (JWT or API key) */
|
|
173
|
+
authToken?: string;
|
|
174
|
+
/** Available DO bindings */
|
|
175
|
+
bindings: DOBinding[];
|
|
176
|
+
/** Enable real-time updates */
|
|
177
|
+
realTimeUpdates: boolean;
|
|
178
|
+
/** WebSocket endpoint for real-time (legacy, prefer doUrl) */
|
|
179
|
+
wsEndpoint?: string;
|
|
180
|
+
/** Conflict resolution strategy for sync */
|
|
181
|
+
conflictStrategy?: ConflictStrategy;
|
|
182
|
+
/** Offline persistence configuration */
|
|
183
|
+
offline?: OfflineConfig;
|
|
184
|
+
/** Collections to auto-sync */
|
|
185
|
+
collections?: string[];
|
|
186
|
+
/** Number of retries for health check (default: 3) */
|
|
187
|
+
healthCheckRetries?: number;
|
|
188
|
+
/**
|
|
189
|
+
* Request timeout in milliseconds for fetch calls
|
|
190
|
+
* @default 30000 (30 seconds)
|
|
191
|
+
*/
|
|
192
|
+
requestTimeout?: number;
|
|
193
|
+
}
|
|
194
|
+
|
|
195
|
+
export type { ConflictStrategy as C, DOAdminConfig as D, OfflineConfig as O, SyncStatus as S, DOStatus as a, DOClassType as b, DOInstance as c, DOAlarm as d, DOStorageEntry as e, DOBinding as f, DORPCMethod as g, DOHealthCheck as h, DOMetrics as i, ConflictResolver as j };
|