skema-core 0.2.0 → 2.1.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/README.md +11 -3
- package/dist/cli.js +896 -63
- package/dist/index.d.mts +37 -7
- package/dist/index.d.ts +37 -7
- package/dist/index.js +739 -136
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +740 -137
- package/dist/index.mjs.map +1 -1
- package/dist/mcp.js +413 -0
- package/dist/server.d.mts +107 -31
- package/dist/server.d.ts +107 -31
- package/dist/server.js +451 -42
- package/dist/server.js.map +1 -1
- package/dist/server.mjs +430 -32
- package/dist/server.mjs.map +1 -1
- package/package.json +11 -4
package/dist/index.d.mts
CHANGED
|
@@ -252,6 +252,8 @@ interface AnnotationPopupProps {
|
|
|
252
252
|
isExiting?: boolean;
|
|
253
253
|
/** Whether this is a multi-select annotation */
|
|
254
254
|
isMultiSelect?: boolean;
|
|
255
|
+
/** Dark mode */
|
|
256
|
+
isDark?: boolean;
|
|
255
257
|
}
|
|
256
258
|
interface AnnotationPopupHandle {
|
|
257
259
|
/** Shake the popup (e.g., when user clicks outside) */
|
|
@@ -259,20 +261,44 @@ interface AnnotationPopupHandle {
|
|
|
259
261
|
}
|
|
260
262
|
declare const AnnotationPopup: React.ForwardRefExoticComponent<AnnotationPopupProps & React.RefAttributes<AnnotationPopupHandle>>;
|
|
261
263
|
|
|
262
|
-
type
|
|
264
|
+
type ProviderName = 'gemini' | 'claude';
|
|
265
|
+
type ExecutionMode = 'direct-cli' | 'mcp';
|
|
266
|
+
interface ProviderStatus {
|
|
267
|
+
installed: boolean;
|
|
268
|
+
authorized: boolean;
|
|
269
|
+
message: string;
|
|
270
|
+
}
|
|
271
|
+
interface AnnotationCounts {
|
|
272
|
+
pending: number;
|
|
273
|
+
acknowledged: number;
|
|
274
|
+
resolved: number;
|
|
275
|
+
dismissed: number;
|
|
276
|
+
}
|
|
263
277
|
interface DaemonState {
|
|
264
278
|
connected: boolean;
|
|
265
|
-
provider:
|
|
266
|
-
|
|
279
|
+
provider: ProviderName;
|
|
280
|
+
mode: ExecutionMode;
|
|
281
|
+
availableProviders: ProviderName[];
|
|
282
|
+
availableModes: ExecutionMode[];
|
|
283
|
+
providerStatus: Record<ProviderName, ProviderStatus>;
|
|
267
284
|
cwd: string;
|
|
285
|
+
mcpServerConnected: boolean;
|
|
286
|
+
mcpClientName: string | null;
|
|
287
|
+
annotationCounts: AnnotationCounts;
|
|
268
288
|
}
|
|
269
289
|
interface AIStreamEvent {
|
|
270
290
|
type: 'init' | 'text' | 'tool_use' | 'tool_result' | 'error' | 'done' | 'debug';
|
|
271
291
|
content?: string;
|
|
272
292
|
timestamp: string;
|
|
273
|
-
provider:
|
|
293
|
+
provider: ProviderName;
|
|
274
294
|
raw?: unknown;
|
|
275
295
|
}
|
|
296
|
+
interface GenerateOptions {
|
|
297
|
+
/** Override execution mode for this request */
|
|
298
|
+
mode?: ExecutionMode;
|
|
299
|
+
/** Override provider for this request */
|
|
300
|
+
provider?: ProviderName;
|
|
301
|
+
}
|
|
276
302
|
interface UseDaemonOptions {
|
|
277
303
|
/** WebSocket URL (default: ws://localhost:9999) */
|
|
278
304
|
url?: string;
|
|
@@ -295,11 +321,15 @@ interface UseDaemonReturn {
|
|
|
295
321
|
/** Disconnect from daemon */
|
|
296
322
|
disconnect: () => void;
|
|
297
323
|
/** Switch AI provider */
|
|
298
|
-
setProvider: (provider:
|
|
324
|
+
setProvider: (provider: ProviderName) => Promise<boolean>;
|
|
325
|
+
/** Switch execution mode */
|
|
326
|
+
setMode: (mode: ExecutionMode) => Promise<boolean>;
|
|
327
|
+
/** Refresh provider status from daemon */
|
|
328
|
+
refreshProviderStatus: () => Promise<void>;
|
|
299
329
|
/** Generate code from annotation (streaming) */
|
|
300
330
|
generate: (annotation: Partial<Annotation> & {
|
|
301
331
|
comment?: string;
|
|
302
|
-
}, onEvent?: (event: AIStreamEvent) => void) => Promise<{
|
|
332
|
+
}, onEvent?: (event: AIStreamEvent) => void, options?: GenerateOptions) => Promise<{
|
|
303
333
|
success: boolean;
|
|
304
334
|
annotationId: string;
|
|
305
335
|
}>;
|
|
@@ -431,4 +461,4 @@ declare function getGridCellReference(x: number, y: number, gridSize?: number):
|
|
|
431
461
|
*/
|
|
432
462
|
declare function extractTextFromShapes(shapes: unknown[]): string;
|
|
433
463
|
|
|
434
|
-
export { type
|
|
464
|
+
export { type AIStreamEvent, type Annotation, type AnnotationCounts, type AnnotationExport, AnnotationPopup, type AnnotationPopupHandle, type AnnotationPopupProps, type BoundingBox, type DOMElement, type DOMSelection, type DaemonState, type DrawingAnnotation, type ElementStyles, type ExecutionMode, type GestureAnnotation, type NearbyElement, type PendingAnnotation, type ProjectStyleContext, type ProviderName, type ProviderStatus, Skema, type SkemaMode, type SkemaProps, type UseDaemonOptions, type UseDaemonReturn, type ViewportInfo, addGridToSvg, bboxCenter, bboxDocumentToViewport, bboxFromPoints, bboxIntersects, bboxViewportToDocument, blobToBase64, createDOMSelection, Skema as default, documentToViewport, expandBbox, extractTextFromShapes, generateSelector, getBoundingBox, getElementClasses, getElementPath, getGridCellReference, getViewportInfo, identifyElement, pointInBbox, shouldIgnoreElement, useDaemon, viewportToDocument };
|
package/dist/index.d.ts
CHANGED
|
@@ -252,6 +252,8 @@ interface AnnotationPopupProps {
|
|
|
252
252
|
isExiting?: boolean;
|
|
253
253
|
/** Whether this is a multi-select annotation */
|
|
254
254
|
isMultiSelect?: boolean;
|
|
255
|
+
/** Dark mode */
|
|
256
|
+
isDark?: boolean;
|
|
255
257
|
}
|
|
256
258
|
interface AnnotationPopupHandle {
|
|
257
259
|
/** Shake the popup (e.g., when user clicks outside) */
|
|
@@ -259,20 +261,44 @@ interface AnnotationPopupHandle {
|
|
|
259
261
|
}
|
|
260
262
|
declare const AnnotationPopup: React.ForwardRefExoticComponent<AnnotationPopupProps & React.RefAttributes<AnnotationPopupHandle>>;
|
|
261
263
|
|
|
262
|
-
type
|
|
264
|
+
type ProviderName = 'gemini' | 'claude';
|
|
265
|
+
type ExecutionMode = 'direct-cli' | 'mcp';
|
|
266
|
+
interface ProviderStatus {
|
|
267
|
+
installed: boolean;
|
|
268
|
+
authorized: boolean;
|
|
269
|
+
message: string;
|
|
270
|
+
}
|
|
271
|
+
interface AnnotationCounts {
|
|
272
|
+
pending: number;
|
|
273
|
+
acknowledged: number;
|
|
274
|
+
resolved: number;
|
|
275
|
+
dismissed: number;
|
|
276
|
+
}
|
|
263
277
|
interface DaemonState {
|
|
264
278
|
connected: boolean;
|
|
265
|
-
provider:
|
|
266
|
-
|
|
279
|
+
provider: ProviderName;
|
|
280
|
+
mode: ExecutionMode;
|
|
281
|
+
availableProviders: ProviderName[];
|
|
282
|
+
availableModes: ExecutionMode[];
|
|
283
|
+
providerStatus: Record<ProviderName, ProviderStatus>;
|
|
267
284
|
cwd: string;
|
|
285
|
+
mcpServerConnected: boolean;
|
|
286
|
+
mcpClientName: string | null;
|
|
287
|
+
annotationCounts: AnnotationCounts;
|
|
268
288
|
}
|
|
269
289
|
interface AIStreamEvent {
|
|
270
290
|
type: 'init' | 'text' | 'tool_use' | 'tool_result' | 'error' | 'done' | 'debug';
|
|
271
291
|
content?: string;
|
|
272
292
|
timestamp: string;
|
|
273
|
-
provider:
|
|
293
|
+
provider: ProviderName;
|
|
274
294
|
raw?: unknown;
|
|
275
295
|
}
|
|
296
|
+
interface GenerateOptions {
|
|
297
|
+
/** Override execution mode for this request */
|
|
298
|
+
mode?: ExecutionMode;
|
|
299
|
+
/** Override provider for this request */
|
|
300
|
+
provider?: ProviderName;
|
|
301
|
+
}
|
|
276
302
|
interface UseDaemonOptions {
|
|
277
303
|
/** WebSocket URL (default: ws://localhost:9999) */
|
|
278
304
|
url?: string;
|
|
@@ -295,11 +321,15 @@ interface UseDaemonReturn {
|
|
|
295
321
|
/** Disconnect from daemon */
|
|
296
322
|
disconnect: () => void;
|
|
297
323
|
/** Switch AI provider */
|
|
298
|
-
setProvider: (provider:
|
|
324
|
+
setProvider: (provider: ProviderName) => Promise<boolean>;
|
|
325
|
+
/** Switch execution mode */
|
|
326
|
+
setMode: (mode: ExecutionMode) => Promise<boolean>;
|
|
327
|
+
/** Refresh provider status from daemon */
|
|
328
|
+
refreshProviderStatus: () => Promise<void>;
|
|
299
329
|
/** Generate code from annotation (streaming) */
|
|
300
330
|
generate: (annotation: Partial<Annotation> & {
|
|
301
331
|
comment?: string;
|
|
302
|
-
}, onEvent?: (event: AIStreamEvent) => void) => Promise<{
|
|
332
|
+
}, onEvent?: (event: AIStreamEvent) => void, options?: GenerateOptions) => Promise<{
|
|
303
333
|
success: boolean;
|
|
304
334
|
annotationId: string;
|
|
305
335
|
}>;
|
|
@@ -431,4 +461,4 @@ declare function getGridCellReference(x: number, y: number, gridSize?: number):
|
|
|
431
461
|
*/
|
|
432
462
|
declare function extractTextFromShapes(shapes: unknown[]): string;
|
|
433
463
|
|
|
434
|
-
export { type
|
|
464
|
+
export { type AIStreamEvent, type Annotation, type AnnotationCounts, type AnnotationExport, AnnotationPopup, type AnnotationPopupHandle, type AnnotationPopupProps, type BoundingBox, type DOMElement, type DOMSelection, type DaemonState, type DrawingAnnotation, type ElementStyles, type ExecutionMode, type GestureAnnotation, type NearbyElement, type PendingAnnotation, type ProjectStyleContext, type ProviderName, type ProviderStatus, Skema, type SkemaMode, type SkemaProps, type UseDaemonOptions, type UseDaemonReturn, type ViewportInfo, addGridToSvg, bboxCenter, bboxDocumentToViewport, bboxFromPoints, bboxIntersects, bboxViewportToDocument, blobToBase64, createDOMSelection, Skema as default, documentToViewport, expandBbox, extractTextFromShapes, generateSelector, getBoundingBox, getElementClasses, getElementPath, getGridCellReference, getViewportInfo, identifyElement, pointInBbox, shouldIgnoreElement, useDaemon, viewportToDocument };
|