skema-core 0.1.2 → 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/dist/server.d.ts CHANGED
@@ -369,7 +369,47 @@ declare function buildDrawingToCodePrompt(input: DrawingInput): string;
369
369
  */
370
370
  declare const IMAGE_ANALYSIS_PROMPT: string;
371
371
 
372
+ /**
373
+ * Execution modes:
374
+ * - 'direct-cli': Annotations processed instantly via CLI agents (gemini/claude CLI tools)
375
+ * - 'mcp': Annotations routed through an AI agent (Cursor, Claude Desktop, etc.)
376
+ */
377
+ type ExecutionMode = 'direct-cli' | 'mcp';
378
+ type ProviderName = 'gemini' | 'claude';
379
+
380
+ interface DaemonConfig {
381
+ /** Port for WebSocket server (default: 9999) */
382
+ port?: number;
383
+ /** Working directory for file operations and AI commands */
384
+ cwd?: string;
385
+ /** Default AI provider */
386
+ defaultProvider?: ProviderName;
387
+ /** Default execution mode */
388
+ defaultMode?: ExecutionMode;
389
+ }
390
+ interface IncomingMessage {
391
+ id: string;
392
+ type: string;
393
+ [key: string]: unknown;
394
+ }
395
+ interface OutgoingMessage {
396
+ id?: string;
397
+ type: string;
398
+ success?: boolean;
399
+ error?: string;
400
+ [key: string]: unknown;
401
+ }
402
+ interface DaemonInstance {
403
+ port: number;
404
+ close: () => void;
405
+ }
406
+ /**
407
+ * Start the Skema daemon (WebSocket server)
408
+ */
409
+ declare function startDaemon(config?: DaemonConfig): DaemonInstance;
410
+
372
411
  type AIProvider = 'gemini' | 'claude';
412
+ type AnyProvider = 'gemini' | 'claude';
373
413
  interface AIProviderConfig {
374
414
  provider: AIProvider;
375
415
  /** Working directory for CLI commands */
@@ -381,7 +421,7 @@ interface AIStreamEvent {
381
421
  type: 'init' | 'text' | 'tool_use' | 'tool_result' | 'error' | 'done' | 'debug';
382
422
  content?: string;
383
423
  timestamp: string;
384
- provider: AIProvider;
424
+ provider: AnyProvider;
385
425
  /** Raw event from the CLI (provider-specific) */
386
426
  raw?: unknown;
387
427
  }
@@ -411,35 +451,6 @@ declare function isProviderAvailable(provider: AIProvider): boolean;
411
451
  */
412
452
  declare function getAvailableProviders(): AIProvider[];
413
453
 
414
- interface DaemonConfig {
415
- /** Port for WebSocket server (default: 9999) */
416
- port?: number;
417
- /** Working directory for file operations and AI commands */
418
- cwd?: string;
419
- /** Default AI provider */
420
- defaultProvider?: AIProvider;
421
- }
422
- interface IncomingMessage {
423
- id: string;
424
- type: string;
425
- [key: string]: unknown;
426
- }
427
- interface OutgoingMessage {
428
- id?: string;
429
- type: string;
430
- success?: boolean;
431
- error?: string;
432
- [key: string]: unknown;
433
- }
434
- interface DaemonInstance {
435
- port: number;
436
- close: () => void;
437
- }
438
- /**
439
- * Start the Skema daemon (WebSocket server)
440
- */
441
- declare function startDaemon(config?: DaemonConfig): DaemonInstance;
442
-
443
454
  interface VisionAnalysisResult {
444
455
  success: boolean;
445
456
  description: string;
@@ -462,4 +473,69 @@ declare function analyzeImage(base64Image: string, config: VisionConfig): Promis
462
473
  */
463
474
  declare function isVisionAvailable(provider: AIProvider): boolean;
464
475
 
465
- export { type AIProvider, type AIProviderConfig, type AIRunResult, type AIStreamEvent, DELETE, type DaemonConfig, type DaemonInstance, type DetailedDomSelectionInput, type DomSelectionInput, type DrawingInput, type GeminiCLIEvent, type GeminiCLIOptions, type GestureInput, IMAGE_ANALYSIS_PROMPT, type IncomingMessage, type OutgoingMessage, POST, type ProjectContext, type VisionAnalysisResult, type VisionConfig, analyzeImage, buildDetailedDomSelectionPrompt, buildDrawingToCodePrompt, buildFastDomSelectionPrompt, buildGesturePrompt, buildPromptFromAnnotation, createGeminiCLIStream, createGeminiRouteHandler, createRevertRouteHandler, getAvailableProviders, getTrackedAnnotations, isProviderAvailable, isVisionAvailable, revertAnnotation, runAICLI, runGeminiCLI, spawnAICLI, spawnGeminiCLI, startDaemon };
476
+ type AnnotationStatus = 'pending' | 'acknowledged' | 'resolved' | 'dismissed';
477
+ interface StoredAnnotation {
478
+ /** The original Skema annotation data */
479
+ annotation: Annotation;
480
+ /** User comment describing the desired change */
481
+ comment: string;
482
+ /** Current status in the MCP workflow */
483
+ status: AnnotationStatus;
484
+ /** When it was queued */
485
+ createdAt: string;
486
+ /** When status last changed */
487
+ updatedAt: string;
488
+ /** If resolved/dismissed, who did it */
489
+ resolvedBy?: 'human' | 'agent';
490
+ /** Resolution summary (from agent) */
491
+ resolutionSummary?: string;
492
+ /** Dismissal reason (from agent) */
493
+ dismissalReason?: string;
494
+ }
495
+ type StoreListener = (event: string, annotation: StoredAnnotation) => void;
496
+ /**
497
+ * Queue an annotation (called when user submits in MCP mode)
498
+ */
499
+ declare function queueAnnotation(annotation: Annotation, comment: string): StoredAnnotation;
500
+ /**
501
+ * Get all pending annotations
502
+ */
503
+ declare function getPendingAnnotations(): StoredAnnotation[];
504
+ /**
505
+ * Get all annotations (any status)
506
+ */
507
+ declare function getAllAnnotations(): StoredAnnotation[];
508
+ /**
509
+ * Get a specific annotation by ID
510
+ */
511
+ declare function getAnnotation(id: string): StoredAnnotation | undefined;
512
+ /**
513
+ * Mark an annotation as acknowledged (agent has seen it)
514
+ */
515
+ declare function acknowledgeAnnotation(id: string): StoredAnnotation | undefined;
516
+ /**
517
+ * Mark an annotation as resolved (agent has implemented the change)
518
+ */
519
+ declare function resolveAnnotation(id: string, summary?: string): StoredAnnotation | undefined;
520
+ /**
521
+ * Dismiss an annotation (agent decided not to address it)
522
+ */
523
+ declare function dismissAnnotation(id: string, reason: string): StoredAnnotation | undefined;
524
+ /**
525
+ * Remove an annotation from the store
526
+ */
527
+ declare function removeAnnotation(id: string): StoredAnnotation | undefined;
528
+ /**
529
+ * Clear all annotations
530
+ */
531
+ declare function clearAnnotations(): void;
532
+ /**
533
+ * Subscribe to store events
534
+ */
535
+ declare function onStoreEvent(listener: StoreListener): () => void;
536
+ /**
537
+ * Get count of pending annotations
538
+ */
539
+ declare function getPendingCount(): number;
540
+
541
+ export { type AIProviderConfig, type AIRunResult, type AIStreamEvent, type AnnotationStatus, type AIProvider as CLIProvider, DELETE, type DaemonConfig, type DaemonInstance, type DetailedDomSelectionInput, type DomSelectionInput, type DrawingInput, type ExecutionMode, type GeminiCLIEvent, type GeminiCLIOptions, type GestureInput, IMAGE_ANALYSIS_PROMPT, type IncomingMessage, type OutgoingMessage, POST, type ProjectContext, type ProviderName, type StoredAnnotation, type VisionAnalysisResult, type VisionConfig, acknowledgeAnnotation, analyzeImage, buildDetailedDomSelectionPrompt, buildDrawingToCodePrompt, buildFastDomSelectionPrompt, buildGesturePrompt, buildPromptFromAnnotation, clearAnnotations, createGeminiCLIStream, createGeminiRouteHandler, createRevertRouteHandler, dismissAnnotation, getAllAnnotations, getAnnotation, getAvailableProviders as getCLIProviders, getPendingAnnotations, getPendingCount, getTrackedAnnotations, isProviderAvailable, isVisionAvailable, onStoreEvent, queueAnnotation, removeAnnotation, resolveAnnotation, revertAnnotation, runAICLI, runGeminiCLI, spawnAICLI, spawnGeminiCLI, startDaemon };