@mdedit/agent-client
Advanced tools
+289
-1
@@ -1,3 +0,291 @@ | ||
| import { ReviewCommand, ArticleReviewCommandsResponse, ReviewCommentThread, ReviewHighlight, ReviewSuggestion, GetArticleReviewResponse, ArticleReviewCommandsRequest, ReviewDocument, ReviewHistoryEvent } from '@mdedit/types'; | ||
| /** | ||
| * Electron API type definitions for renderer process | ||
| * | ||
| * Note: This is a runtime-safe module so bundlers can resolve `import './electron'` | ||
| * from `packages/types/src/index.ts` while still contributing global typings. | ||
| */ | ||
| declare global { | ||
| interface Window { | ||
| electron?: { | ||
| invoke: (channel: string, ...args: any[]) => Promise<any>; | ||
| send: (channel: string, ...args: any[]) => void; | ||
| on: (channel: string, callback: (...args: any[]) => void) => void; | ||
| platform: 'darwin' | 'win32' | 'linux'; | ||
| version: string; | ||
| }; | ||
| process?: { | ||
| type: string; | ||
| versions: { | ||
| electron?: string; | ||
| }; | ||
| }; | ||
| } | ||
| } | ||
| type ReviewTargetId = string; | ||
| type ReviewId = string; | ||
| type ReviewHashAlg = 'sha256'; | ||
| type ReviewAuthor = { | ||
| userId: string; | ||
| displayName: string; | ||
| avatarUrl?: string; | ||
| kind?: 'human' | 'agent'; | ||
| /** Opaque, server-attested identity for the API key acting as this agent. */ | ||
| agentId?: string; | ||
| agentName?: string; | ||
| onBehalfOf?: string; | ||
| }; | ||
| type ReviewAnchorKind = 'comment' | 'highlight' | 'insert' | 'delete' | 'replace'; | ||
| type ReviewAnchorScope = 'inline' | 'block'; | ||
| type ReviewAnchor = { | ||
| kind: ReviewAnchorKind; | ||
| scope: ReviewAnchorScope; | ||
| from?: number; | ||
| to?: number; | ||
| text?: string; | ||
| before?: string; | ||
| after?: string; | ||
| textHash?: string; | ||
| blockPath?: string; | ||
| }; | ||
| type ReviewCommentThread = { | ||
| id: ReviewId; | ||
| anchor: ReviewAnchor; | ||
| body: string; | ||
| status: 'open' | 'resolved' | 'reopened' | 'orphaned'; | ||
| createdBy?: ReviewAuthor; | ||
| assignedTo?: ReviewAuthor; | ||
| createdAt: string; | ||
| updatedAt?: string; | ||
| resolvedBy?: ReviewAuthor; | ||
| resolvedAt?: string; | ||
| replies?: ReviewReply[]; | ||
| }; | ||
| type ReviewReply = { | ||
| id: ReviewId; | ||
| body: string; | ||
| createdBy?: ReviewAuthor; | ||
| createdAt: string; | ||
| updatedAt?: string; | ||
| deletedAt?: string; | ||
| }; | ||
| type ReviewSuggestion = { | ||
| id: ReviewId; | ||
| kind: 'insert' | 'delete' | 'replace'; | ||
| originalText?: string; | ||
| suggestedText?: string; | ||
| status: 'open' | 'accepted' | 'rejected' | 'orphaned'; | ||
| createdBy?: ReviewAuthor; | ||
| assignedTo?: ReviewAuthor; | ||
| createdAt: string; | ||
| updatedAt?: string; | ||
| decidedBy?: ReviewAuthor; | ||
| decidedAt?: string; | ||
| note?: string; | ||
| replies?: ReviewReply[]; | ||
| }; | ||
| type ReviewHighlight = { | ||
| id: ReviewId; | ||
| anchor: ReviewAnchor; | ||
| status: 'open' | 'resolved' | 'orphaned'; | ||
| createdBy?: ReviewAuthor; | ||
| assignedTo?: ReviewAuthor; | ||
| createdAt: string; | ||
| updatedAt?: string; | ||
| note?: string; | ||
| }; | ||
| type ReviewTargetDocument = { | ||
| comments?: Record<ReviewId, ReviewCommentThread>; | ||
| suggestions?: Record<ReviewId, ReviewSuggestion>; | ||
| highlights?: Record<ReviewId, ReviewHighlight>; | ||
| updatedAt?: string; | ||
| }; | ||
| type ReviewHistoryEventType = 'created' | 'replied' | 'resolved' | 'reopened' | 'accepted' | 'rejected' | 'orphaned' | 'anchor_repaired' | 'assigned' | 'unassigned' | 'deleted' | 'reply_deleted'; | ||
| type ReviewHistoryEvent = { | ||
| id: ReviewId; | ||
| reviewId: ReviewId; | ||
| targetId: ReviewTargetId; | ||
| type: ReviewHistoryEventType; | ||
| actor?: ReviewAuthor; | ||
| at: string; | ||
| metadata?: Record<string, unknown>; | ||
| }; | ||
| type ReviewDocument = { | ||
| version: 1; | ||
| targets: Record<ReviewTargetId, ReviewTargetDocument>; | ||
| history?: ReviewHistoryEvent[]; | ||
| /** Server-written receipts used to make command batches safe to replay. */ | ||
| commandReceipts?: Record<string, ReviewCommandReceipt>; | ||
| updatedAt?: string; | ||
| }; | ||
| type ReviewCommandReceipt = { | ||
| appliedAt: string; | ||
| eventIds: ReviewId[]; | ||
| /** Attempt-scoped usage reservation finalized by receipt-aware retries. */ | ||
| quotaOperationId?: string; | ||
| }; | ||
| type EditorSelection = { | ||
| from: number; | ||
| to: number; | ||
| text: string; | ||
| }; | ||
| type ReviewQuoteContext = { | ||
| before?: string; | ||
| after?: string; | ||
| }; | ||
| type ReviewQuoteAnchor = { | ||
| quote: string; | ||
| /** One-based occurrence after context filtering. */ | ||
| occurrence?: number; | ||
| context?: ReviewQuoteContext; | ||
| }; | ||
| type ReviewHeadingAnchor = { | ||
| beforeHeading: string; | ||
| } | { | ||
| afterHeading: string; | ||
| } | { | ||
| inSection: string; | ||
| }; | ||
| type ReviewSuggestionInput = { | ||
| kind: 'insert'; | ||
| suggestedText: string; | ||
| } | { | ||
| kind: 'delete'; | ||
| originalText: string; | ||
| } | { | ||
| kind: 'replace'; | ||
| originalText: string; | ||
| suggestedText: string; | ||
| }; | ||
| type ReviewInlineCommandLocation = { | ||
| range: EditorSelection; | ||
| anchor?: undefined; | ||
| } | { | ||
| anchor: ReviewQuoteAnchor; | ||
| range?: undefined; | ||
| }; | ||
| type ReviewBlockCommandLocation = { | ||
| blockOffset: number; | ||
| anchor?: undefined; | ||
| } | { | ||
| anchor: ReviewHeadingAnchor; | ||
| blockOffset?: undefined; | ||
| }; | ||
| type ReviewCommand = ({ | ||
| type: 'add-comment'; | ||
| targetId: ReviewTargetId; | ||
| reviewId?: ReviewId; | ||
| body: string; | ||
| } & ReviewInlineCommandLocation) | ({ | ||
| type: 'add-block-comment'; | ||
| targetId: ReviewTargetId; | ||
| reviewId?: ReviewId; | ||
| blockPath?: string; | ||
| body: string; | ||
| } & ReviewBlockCommandLocation) | ({ | ||
| type: 'add-highlight'; | ||
| targetId: ReviewTargetId; | ||
| reviewId?: ReviewId; | ||
| note?: string; | ||
| } & ReviewInlineCommandLocation) | ({ | ||
| type: 'add-block-highlight'; | ||
| targetId: ReviewTargetId; | ||
| reviewId?: ReviewId; | ||
| blockPath?: string; | ||
| note?: string; | ||
| } & ReviewBlockCommandLocation) | ({ | ||
| type: 'add-suggestion'; | ||
| targetId: ReviewTargetId; | ||
| reviewId?: ReviewId; | ||
| suggestion: ReviewSuggestionInput; | ||
| note?: string; | ||
| } & ReviewInlineCommandLocation) | { | ||
| type: 'reply'; | ||
| targetId: ReviewTargetId; | ||
| threadId: ReviewId; | ||
| replyId?: ReviewId; | ||
| body: string; | ||
| } | { | ||
| type: 'delete-reply'; | ||
| targetId: ReviewTargetId; | ||
| reviewId: ReviewId; | ||
| replyId: ReviewId; | ||
| } | { | ||
| type: 'resolve'; | ||
| targetId: ReviewTargetId; | ||
| threadId: ReviewId; | ||
| } | { | ||
| type: 'reopen'; | ||
| targetId: ReviewTargetId; | ||
| threadId: ReviewId; | ||
| } | { | ||
| type: 'accept-suggestion'; | ||
| targetId: ReviewTargetId; | ||
| suggestionId: ReviewId; | ||
| } | { | ||
| type: 'reject-suggestion'; | ||
| targetId: ReviewTargetId; | ||
| suggestionId: ReviewId; | ||
| } | { | ||
| type: 'assign-review-item'; | ||
| targetId: ReviewTargetId; | ||
| reviewId: ReviewId; | ||
| assignedTo?: ReviewAuthor; | ||
| } | { | ||
| type: 'delete-review-item'; | ||
| targetId: ReviewTargetId; | ||
| reviewId: ReviewId; | ||
| } | ({ | ||
| type: 'repair-anchor'; | ||
| targetId: ReviewTargetId; | ||
| reviewId: ReviewId; | ||
| } & ReviewInlineCommandLocation) | { | ||
| type: 'remove-review-marker'; | ||
| targetId: ReviewTargetId; | ||
| from: number; | ||
| to: number; | ||
| text?: string; | ||
| }; | ||
| type ArticleReviewCommandsRequest = { | ||
| /** Client-generated id shared by every retry of this batch. */ | ||
| commandId: string; | ||
| commands: ReviewCommand[]; | ||
| }; | ||
| type ArticleReviewCommandsResponse = { | ||
| commandId: string; | ||
| applied: boolean; | ||
| events: ReviewHistoryEvent[]; | ||
| targetHashes?: Record<ReviewTargetId, string>; | ||
| targetRevisions?: Record<ReviewTargetId, number>; | ||
| reviewHash?: string; | ||
| reviewRevision?: number; | ||
| packageRevision?: number; | ||
| articleRevision?: number; | ||
| }; | ||
| type GetArticleReviewResponse = { | ||
| articleId: string; | ||
| review: ReviewDocument; | ||
| reviewHash?: string; | ||
| reviewHashAlg?: ReviewHashAlg; | ||
| reviewRevision?: number; | ||
| packageRevision?: number; | ||
| }; | ||
| /** | ||
| * OAuth type definitions for mdedit.ai | ||
| * | ||
| * Note: This is a runtime-safe module so bundlers can resolve `export * from './oauth'` | ||
| * while still contributing global typings. | ||
| */ | ||
| /** | ||
| * Extend Window interface with custom OAuth events | ||
| */ | ||
| declare global { | ||
| interface WindowEventMap { | ||
| 'github-auth-success': CustomEvent; | ||
| } | ||
| } | ||
| type AgentIdentity = { | ||
@@ -4,0 +292,0 @@ name: string; |
+3
-3
| { | ||
| "name": "@mdedit/agent-client", | ||
| "version": "1.0.0", | ||
| "version": "1.0.1", | ||
| "private": false, | ||
@@ -44,4 +44,2 @@ "type": "module", | ||
| "@hocuspocus/provider": "^4.2.0", | ||
| "@mdedit/markdown-parser": "0.2.0", | ||
| "@mdedit/types": "0.2.0", | ||
| "diff": "^8.0.1", | ||
@@ -55,2 +53,4 @@ "ws": "^8.18.3", | ||
| "@mdedit/collaboration": "0.0.0", | ||
| "@mdedit/markdown-parser": "0.2.0", | ||
| "@mdedit/types": "0.2.0", | ||
| "@types/node": "^20.10.5", | ||
@@ -57,0 +57,0 @@ "@types/ws": "^8.18.1", |
Deprecated
MaintenanceThe maintainer of the package marked it as deprecated. This could indicate that a single version should not be used, or that the package is no longer maintained and any new vulnerabilities will not be fixed.
1124820
0.66%5
-28.57%11504
2.53%0
-100%9
28.57%- Removed
- Removed