next-ai-editor 0.1.2 → 0.2.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/AIEditorProvider-CKA2K_g2.js +1428 -0
- package/dist/AIEditorProvider-CKA2K_g2.js.map +1 -0
- package/dist/AIEditorProvider-C_zRSAuV.cjs +1427 -0
- package/dist/AIEditorProvider-C_zRSAuV.cjs.map +1 -0
- package/dist/client/AIEditorProvider.d.ts +1 -33
- package/dist/client/AIEditorProvider.d.ts.map +1 -1
- package/dist/client/components/ChatPanel.d.ts +18 -0
- package/dist/client/components/ChatPanel.d.ts.map +1 -0
- package/dist/client/components/ControlPill.d.ts +8 -0
- package/dist/client/components/ControlPill.d.ts.map +1 -0
- package/dist/client/components/MessageItem.d.ts +7 -0
- package/dist/client/components/MessageItem.d.ts.map +1 -0
- package/dist/client/components/MessageList.d.ts +7 -0
- package/dist/client/components/MessageList.d.ts.map +1 -0
- package/dist/client/components/TaskHistoryPanel.d.ts +10 -0
- package/dist/client/components/TaskHistoryPanel.d.ts.map +1 -0
- package/dist/client/components/index.d.ts +11 -0
- package/dist/client/components/index.d.ts.map +1 -0
- package/dist/client/hooks/index.d.ts +3 -0
- package/dist/client/hooks/index.d.ts.map +1 -0
- package/dist/client/hooks/useChatStream.d.ts +66 -0
- package/dist/client/hooks/useChatStream.d.ts.map +1 -0
- package/dist/client/hooks/useHotReload.d.ts +10 -0
- package/dist/client/hooks/useHotReload.d.ts.map +1 -0
- package/dist/client/index.d.ts +3 -0
- package/dist/client/index.d.ts.map +1 -1
- package/dist/client.cjs +7 -1
- package/dist/client.cjs.map +1 -1
- package/dist/client.js +8 -2
- package/dist/client.js.map +1 -1
- package/dist/{index-3OMXRwpD.js → comments-D3m0RsOO.js} +505 -26
- package/dist/comments-D3m0RsOO.js.map +1 -0
- package/dist/{index-9QODCOgD.cjs → comments-Daur80r4.cjs} +492 -13
- package/dist/comments-Daur80r4.cjs.map +1 -0
- package/dist/index.cjs +34 -26
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +22 -14
- package/dist/index.js.map +1 -1
- package/dist/next-ai-editor.css +880 -0
- package/dist/server/agent/sdk-client.d.ts +54 -0
- package/dist/server/agent/sdk-client.d.ts.map +1 -0
- package/dist/server/agent/session-store.d.ts +101 -0
- package/dist/server/agent/session-store.d.ts.map +1 -0
- package/dist/server/handlers/chat.d.ts +6 -0
- package/dist/server/handlers/chat.d.ts.map +1 -0
- package/dist/server/handlers/comments.d.ts +10 -0
- package/dist/server/handlers/comments.d.ts.map +1 -0
- package/dist/server/handlers/index.d.ts +2 -1
- package/dist/server/handlers/index.d.ts.map +1 -1
- package/dist/server/handlers/read.d.ts.map +1 -1
- package/dist/server/index.d.ts +1 -0
- package/dist/server/index.d.ts.map +1 -1
- package/dist/server/utils/ast.d.ts.map +1 -1
- package/dist/server/utils/source-map.d.ts +5 -0
- package/dist/server/utils/source-map.d.ts.map +1 -1
- package/dist/server.cjs +27 -25
- package/dist/server.cjs.map +1 -1
- package/dist/server.js +14 -12
- package/dist/shared/comment-types.d.ts +140 -0
- package/dist/shared/comment-types.d.ts.map +1 -0
- package/package.json +13 -4
- package/dist/AIEditorProvider-CFFnEtEB.js +0 -2170
- package/dist/AIEditorProvider-CFFnEtEB.js.map +0 -1
- package/dist/AIEditorProvider-CmiACRfw.cjs +0 -2169
- package/dist/AIEditorProvider-CmiACRfw.cjs.map +0 -1
- package/dist/index-3OMXRwpD.js.map +0 -1
- package/dist/index-9QODCOgD.cjs.map +0 -1
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import { type SDKMessage } from "@anthropic-ai/claude-agent-sdk";
|
|
2
|
+
/**
|
|
3
|
+
* Configuration for the AI editor agent
|
|
4
|
+
*/
|
|
5
|
+
export interface AIEditorAgentConfig {
|
|
6
|
+
apiKey: string;
|
|
7
|
+
projectRoot: string;
|
|
8
|
+
sessionId?: string;
|
|
9
|
+
allowedTools?: string[];
|
|
10
|
+
disallowedTools?: string[];
|
|
11
|
+
}
|
|
12
|
+
/**
|
|
13
|
+
* Context about the selected component (optional)
|
|
14
|
+
*/
|
|
15
|
+
export interface ComponentContext {
|
|
16
|
+
filePath: string;
|
|
17
|
+
lineNumber: number;
|
|
18
|
+
componentName: string;
|
|
19
|
+
elementContext?: {
|
|
20
|
+
tagName?: string;
|
|
21
|
+
className?: string;
|
|
22
|
+
textContent?: string;
|
|
23
|
+
[key: string]: any;
|
|
24
|
+
};
|
|
25
|
+
}
|
|
26
|
+
/**
|
|
27
|
+
* Wrapper around Claude Agent SDK for the AI editor
|
|
28
|
+
*/
|
|
29
|
+
export declare class AIEditorAgent {
|
|
30
|
+
private session;
|
|
31
|
+
private projectRoot;
|
|
32
|
+
private constructor();
|
|
33
|
+
/**
|
|
34
|
+
* Create a new agent instance
|
|
35
|
+
*/
|
|
36
|
+
static create(config: AIEditorAgentConfig): Promise<AIEditorAgent>;
|
|
37
|
+
/**
|
|
38
|
+
* Send a message to the agent and stream responses
|
|
39
|
+
*/
|
|
40
|
+
sendMessage(message: string, componentContext?: ComponentContext): AsyncGenerator<SDKMessage, void, unknown>;
|
|
41
|
+
/**
|
|
42
|
+
* Get the session ID
|
|
43
|
+
*/
|
|
44
|
+
getSessionId(): string;
|
|
45
|
+
/**
|
|
46
|
+
* Close the session
|
|
47
|
+
*/
|
|
48
|
+
close(): void;
|
|
49
|
+
/**
|
|
50
|
+
* Async disposal support
|
|
51
|
+
*/
|
|
52
|
+
[Symbol.asyncDispose](): Promise<void>;
|
|
53
|
+
}
|
|
54
|
+
//# sourceMappingURL=sdk-client.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sdk-client.d.ts","sourceRoot":"","sources":["../../../src/server/agent/sdk-client.ts"],"names":[],"mappings":"AAAA,OAAO,EAKL,KAAK,UAAU,EAChB,MAAM,gCAAgC,CAAC;AAExC;;GAEG;AACH,MAAM,WAAW,mBAAmB;IAClC,MAAM,EAAE,MAAM,CAAC;IACf,WAAW,EAAE,MAAM,CAAC;IACpB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,YAAY,CAAC,EAAE,MAAM,EAAE,CAAC;IACxB,eAAe,CAAC,EAAE,MAAM,EAAE,CAAC;CAC5B;AAED;;GAEG;AACH,MAAM,WAAW,gBAAgB;IAC/B,QAAQ,EAAE,MAAM,CAAC;IACjB,UAAU,EAAE,MAAM,CAAC;IACnB,aAAa,EAAE,MAAM,CAAC;IACtB,cAAc,CAAC,EAAE;QACf,OAAO,CAAC,EAAE,MAAM,CAAC;QACjB,SAAS,CAAC,EAAE,MAAM,CAAC;QACnB,WAAW,CAAC,EAAE,MAAM,CAAC;QACrB,CAAC,GAAG,EAAE,MAAM,GAAG,GAAG,CAAC;KACpB,CAAC;CACH;AAED;;GAEG;AACH,qBAAa,aAAa;IACxB,OAAO,CAAC,OAAO,CAAa;IAC5B,OAAO,CAAC,WAAW,CAAS;IAE5B,OAAO;IAKP;;OAEG;WACU,MAAM,CAAC,MAAM,EAAE,mBAAmB,GAAG,OAAO,CAAC,aAAa,CAAC;IA4BxE;;OAEG;IACI,WAAW,CAChB,OAAO,EAAE,MAAM,EACf,gBAAgB,CAAC,EAAE,gBAAgB,GAClC,cAAc,CAAC,UAAU,EAAE,IAAI,EAAE,OAAO,CAAC;IA6B5C;;OAEG;IACH,YAAY,IAAI,MAAM;IAItB;;OAEG;IACH,KAAK,IAAI,IAAI;IAIb;;OAEG;IACG,CAAC,MAAM,CAAC,YAAY,CAAC,IAAI,OAAO,CAAC,IAAI,CAAC;CAG7C"}
|
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
import { AIEditorAgent } from "./sdk-client.js";
|
|
2
|
+
/**
|
|
3
|
+
* Represents an active agent session
|
|
4
|
+
*/
|
|
5
|
+
export interface AgentSession {
|
|
6
|
+
sessionId: string;
|
|
7
|
+
threadId: string;
|
|
8
|
+
agent: AIEditorAgent;
|
|
9
|
+
createdAt: number;
|
|
10
|
+
lastActive: number;
|
|
11
|
+
isLocked: boolean;
|
|
12
|
+
}
|
|
13
|
+
/**
|
|
14
|
+
* Configuration for creating a new session
|
|
15
|
+
*/
|
|
16
|
+
export interface CreateSessionConfig {
|
|
17
|
+
sessionId?: string;
|
|
18
|
+
threadId: string;
|
|
19
|
+
apiKey: string;
|
|
20
|
+
projectRoot: string;
|
|
21
|
+
allowedTools?: string[];
|
|
22
|
+
disallowedTools?: string[];
|
|
23
|
+
}
|
|
24
|
+
/**
|
|
25
|
+
* Manages agent sessions across requests
|
|
26
|
+
* Sessions are stored in-memory and automatically cleaned up after inactivity
|
|
27
|
+
*/
|
|
28
|
+
export declare class AgentSessionStore {
|
|
29
|
+
private sessions;
|
|
30
|
+
private readonly SESSION_TIMEOUT;
|
|
31
|
+
private readonly CLEANUP_INTERVAL;
|
|
32
|
+
constructor();
|
|
33
|
+
/**
|
|
34
|
+
* Create or resume a session
|
|
35
|
+
*/
|
|
36
|
+
createSession(config: CreateSessionConfig): Promise<AgentSession>;
|
|
37
|
+
/**
|
|
38
|
+
* Get a session by ID
|
|
39
|
+
*/
|
|
40
|
+
getSession(sessionId: string): AgentSession | undefined;
|
|
41
|
+
/**
|
|
42
|
+
* Acquire a lock on a session to prevent concurrent edits
|
|
43
|
+
* Returns true if lock was acquired, false if already locked
|
|
44
|
+
*/
|
|
45
|
+
acquireLock(sessionId: string): boolean;
|
|
46
|
+
/**
|
|
47
|
+
* Release a lock on a session
|
|
48
|
+
*/
|
|
49
|
+
releaseLock(sessionId: string): void;
|
|
50
|
+
/**
|
|
51
|
+
* Check if any session is currently locked (to prevent concurrent edits)
|
|
52
|
+
*/
|
|
53
|
+
hasActiveLock(): boolean;
|
|
54
|
+
/**
|
|
55
|
+
* Get all active sessions for a thread
|
|
56
|
+
*/
|
|
57
|
+
getSessionsByThread(threadId: string): AgentSession[];
|
|
58
|
+
/**
|
|
59
|
+
* Delete a session
|
|
60
|
+
*/
|
|
61
|
+
deleteSession(sessionId: string): void;
|
|
62
|
+
/**
|
|
63
|
+
* Delete all sessions for a thread
|
|
64
|
+
*/
|
|
65
|
+
deleteSessionsByThread(threadId: string): void;
|
|
66
|
+
/**
|
|
67
|
+
* Get all active sessions
|
|
68
|
+
*/
|
|
69
|
+
getAllSessions(): AgentSession[];
|
|
70
|
+
/**
|
|
71
|
+
* Clean up expired sessions
|
|
72
|
+
*/
|
|
73
|
+
private cleanupExpiredSessions;
|
|
74
|
+
/**
|
|
75
|
+
* Start periodic cleanup timer
|
|
76
|
+
*/
|
|
77
|
+
private startCleanupTimer;
|
|
78
|
+
/**
|
|
79
|
+
* Generate a unique session ID
|
|
80
|
+
*/
|
|
81
|
+
private generateSessionId;
|
|
82
|
+
/**
|
|
83
|
+
* Get statistics about the session store
|
|
84
|
+
*/
|
|
85
|
+
getStats(): {
|
|
86
|
+
totalSessions: number;
|
|
87
|
+
lockedSessions: number;
|
|
88
|
+
sessions: {
|
|
89
|
+
sessionId: string;
|
|
90
|
+
threadId: string;
|
|
91
|
+
isLocked: boolean;
|
|
92
|
+
ageMinutes: number;
|
|
93
|
+
inactiveMinutes: number;
|
|
94
|
+
}[];
|
|
95
|
+
};
|
|
96
|
+
}
|
|
97
|
+
/**
|
|
98
|
+
* Get the global session store instance
|
|
99
|
+
*/
|
|
100
|
+
export declare function getSessionStore(): AgentSessionStore;
|
|
101
|
+
//# sourceMappingURL=session-store.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"session-store.d.ts","sourceRoot":"","sources":["../../../src/server/agent/session-store.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAA4B,MAAM,iBAAiB,CAAC;AAE1E;;GAEG;AACH,MAAM,WAAW,YAAY;IAC3B,SAAS,EAAE,MAAM,CAAC;IAClB,QAAQ,EAAE,MAAM,CAAC;IACjB,KAAK,EAAE,aAAa,CAAC;IACrB,SAAS,EAAE,MAAM,CAAC;IAClB,UAAU,EAAE,MAAM,CAAC;IACnB,QAAQ,EAAE,OAAO,CAAC;CACnB;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":3,"file":"chat.d.ts","sourceRoot":"","sources":["../../../src/server/handlers/chat.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,WAAW,EAAgB,MAAM,aAAa,CAAC;AAYxD;;GAEG;AACH,wBAAsB,UAAU,CAAC,GAAG,EAAE,WAAW,GAAG,OAAO,CAAC,QAAQ,CAAC,CAgHpE"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Comment persistence handler
|
|
3
|
+
* Saves/loads comments to/from .ai-editor/comments.json
|
|
4
|
+
*/
|
|
5
|
+
import { NextRequest, NextResponse } from "next/server";
|
|
6
|
+
/**
|
|
7
|
+
* Handle comment persistence requests
|
|
8
|
+
*/
|
|
9
|
+
export declare function handleCommentsRequest(request: NextRequest): Promise<NextResponse>;
|
|
10
|
+
//# sourceMappingURL=comments.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"comments.d.ts","sourceRoot":"","sources":["../../../src/server/handlers/comments.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,WAAW,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAgCxD;;GAEG;AACH,wBAAsB,qBAAqB,CACzC,OAAO,EAAE,WAAW,GACnB,OAAO,CAAC,YAAY,CAAC,CAmEvB"}
|
|
@@ -10,10 +10,11 @@ import { NextRequest, NextResponse } from "next/server";
|
|
|
10
10
|
* - GET /api/ai-editor/absolute-path -> handleAbsolutePath
|
|
11
11
|
* - POST /api/ai-editor/validate-session -> handleValidateSession
|
|
12
12
|
* - GET /api/ai-editor/suggestions -> handleSuggestions
|
|
13
|
+
* - POST /api/ai-editor/chat -> handleChat (SSE)
|
|
13
14
|
*/
|
|
14
15
|
export declare function handleAIEditorRequest(req: NextRequest, context: {
|
|
15
16
|
params: Promise<{
|
|
16
17
|
path: string[];
|
|
17
18
|
}>;
|
|
18
|
-
}): Promise<NextResponse>;
|
|
19
|
+
}): Promise<NextResponse | Response>;
|
|
19
20
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/server/handlers/index.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,WAAW,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/server/handlers/index.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,WAAW,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAUxD;;;;;;;;;;;;GAYG;AACH,wBAAsB,qBAAqB,CACzC,GAAG,EAAE,WAAW,EAChB,OAAO,EAAE;IAAE,MAAM,EAAE,OAAO,CAAC;QAAE,IAAI,EAAE,MAAM,EAAE,CAAA;KAAE,CAAC,CAAA;CAAE,GAC/C,OAAO,CAAC,YAAY,GAAG,QAAQ,CAAC,CAoClC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"read.d.ts","sourceRoot":"","sources":["../../../src/server/handlers/read.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,WAAW,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAexD,wBAAsB,UAAU,CAAC,GAAG,EAAE,WAAW,GAAG,OAAO,CAAC,YAAY,CAAC,
|
|
1
|
+
{"version":3,"file":"read.d.ts","sourceRoot":"","sources":["../../../src/server/handlers/read.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,WAAW,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAexD,wBAAsB,UAAU,CAAC,GAAG,EAAE,WAAW,GAAG,OAAO,CAAC,YAAY,CAAC,CA+MxE"}
|
package/dist/server/index.d.ts
CHANGED
|
@@ -6,6 +6,7 @@ export { handleResolve } from "./handlers/resolve";
|
|
|
6
6
|
export { handleAbsolutePath } from "./handlers/absolute-path";
|
|
7
7
|
export { handleValidateSession } from "./handlers/validate-session";
|
|
8
8
|
export { handleSuggestions } from "./handlers/suggestions";
|
|
9
|
+
export { handleCommentsRequest } from "./handlers/comments";
|
|
9
10
|
export * from "./utils/file-system";
|
|
10
11
|
export * from "./utils/ast";
|
|
11
12
|
export * from "./utils/source-map";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/server/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,qBAAqB,EAAE,MAAM,YAAY,CAAC;AAGnD,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAC7C,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAC7C,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAC7C,OAAO,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AACnD,OAAO,EAAE,kBAAkB,EAAE,MAAM,0BAA0B,CAAC;AAC9D,OAAO,EAAE,qBAAqB,EAAE,MAAM,6BAA6B,CAAC;AACpE,OAAO,EAAE,iBAAiB,EAAE,MAAM,wBAAwB,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/server/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,qBAAqB,EAAE,MAAM,YAAY,CAAC;AAGnD,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAC7C,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAC7C,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAC7C,OAAO,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AACnD,OAAO,EAAE,kBAAkB,EAAE,MAAM,0BAA0B,CAAC;AAC9D,OAAO,EAAE,qBAAqB,EAAE,MAAM,6BAA6B,CAAC;AACpE,OAAO,EAAE,iBAAiB,EAAE,MAAM,wBAAwB,CAAC;AAC3D,OAAO,EAAE,qBAAqB,EAAE,MAAM,qBAAqB,CAAC;AAG5D,cAAc,qBAAqB,CAAC;AACpC,cAAc,aAAa,CAAC;AAC5B,cAAc,oBAAoB,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ast.d.ts","sourceRoot":"","sources":["../../../src/server/utils/ast.ts"],"names":[],"mappings":"AAQA,OAAO,KAAK,CAAC,MAAM,cAAc,CAAC;AAClC,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AAMzD,MAAM,WAAW,YAAY;IAC3B,IAAI,EAAE,CAAC,CAAC,UAAU,GAAG,CAAC,CAAC,WAAW,CAAC;IACnC,SAAS,EAAE,MAAM,CAAC;IAClB,OAAO,EAAE,MAAM,CAAC;IAChB,KAAK,EAAE,MAAM,CAAC;CACf;AAED,MAAM,WAAW,mBAAmB;IAClC,SAAS,EAAE,MAAM,CAAC;IAClB,OAAO,EAAE,MAAM,CAAC;IAChB,cAAc,EAAE,MAAM,CAAC;IACvB,YAAY,EAAE,MAAM,CAAC;CACtB;AAMD;;GAEG;AACH,wBAAgB,SAAS,CAAC,OAAO,EAAE,MAAM,GAAG,CAAC,CAAC,IAAI,GAAG,IAAI,CAiBxD;AAED;;;GAGG;AACH,wBAAgB,oBAAoB,CAAC,GAAG,EAAE,CAAC,CAAC,IAAI,GAAG,MAAM,GAAG,IAAI,
|
|
1
|
+
{"version":3,"file":"ast.d.ts","sourceRoot":"","sources":["../../../src/server/utils/ast.ts"],"names":[],"mappings":"AAQA,OAAO,KAAK,CAAC,MAAM,cAAc,CAAC;AAClC,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AAMzD,MAAM,WAAW,YAAY;IAC3B,IAAI,EAAE,CAAC,CAAC,UAAU,GAAG,CAAC,CAAC,WAAW,CAAC;IACnC,SAAS,EAAE,MAAM,CAAC;IAClB,OAAO,EAAE,MAAM,CAAC;IAChB,KAAK,EAAE,MAAM,CAAC;CACf;AAED,MAAM,WAAW,mBAAmB;IAClC,SAAS,EAAE,MAAM,CAAC;IAClB,OAAO,EAAE,MAAM,CAAC;IAChB,cAAc,EAAE,MAAM,CAAC;IACvB,YAAY,EAAE,MAAM,CAAC;CACtB;AAMD;;GAEG;AACH,wBAAgB,SAAS,CAAC,OAAO,EAAE,MAAM,GAAG,CAAC,CAAC,IAAI,GAAG,IAAI,CAiBxD;AAED;;;GAGG;AACH,wBAAgB,oBAAoB,CAAC,GAAG,EAAE,CAAC,CAAC,IAAI,GAAG,MAAM,GAAG,IAAI,CAmC/D;AAMD;;;GAGG;AACH,wBAAgB,qBAAqB,CACnC,OAAO,EAAE,MAAM,EACf,YAAY,EAAE,MAAM,EACpB,WAAW,CAAC,EAAE,MAAM,GACnB,OAAO,CAuDT;AAMD;;GAEG;AACH,wBAAgB,iBAAiB,CAC/B,GAAG,EAAE,CAAC,CAAC,IAAI,EACX,WAAW,EAAE,MAAM,EACnB,OAAO,EAAE;IACP,aAAa,EAAE,MAAM,CAAC;IACtB,UAAU,EAAE,MAAM,CAAC;IACnB,cAAc,CAAC,EAAE,cAAc,CAAC;CACjC,GACA,mBAAmB,GAAG,IAAI,CAwN5B;AAMD;;GAEG;AACH,wBAAgB,iBAAiB,CAC/B,IAAI,EAAE,CAAC,CAAC,UAAU,EAClB,OAAO,EAAE,cAAc,EACvB,WAAW,EAAE,MAAM,GAClB,MAAM,CA6ER;AAED;;GAEG;AACH,wBAAgB,gBAAgB,CAAC,IAAI,EAAE,CAAC,CAAC,mBAAmB,GAAG,MAAM,CAQpE;AAED;;GAEG;AACH,wBAAgB,iBAAiB,CAAC,IAAI,EAAE,CAAC,CAAC,YAAY,GAAG,MAAM,GAAG,IAAI,CAUrE"}
|
|
@@ -15,6 +15,11 @@ interface OriginalPosition {
|
|
|
15
15
|
* With turbopack, the file path is the compiled JS file path
|
|
16
16
|
*/
|
|
17
17
|
export declare function parseDebugStack(stack: string | any): CompiledPosition | null;
|
|
18
|
+
/**
|
|
19
|
+
* Extract component name from debug stack
|
|
20
|
+
* Format: "at ComponentName (file-path:line:column)"
|
|
21
|
+
*/
|
|
22
|
+
export declare function extractComponentNameFromStack(stack: string | any): string | null;
|
|
18
23
|
/**
|
|
19
24
|
* Parse debug stack to extract both component instance (parent) and definition
|
|
20
25
|
* Returns up to 2 frames: [componentDefinition, parentInstance]
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"source-map.d.ts","sourceRoot":"","sources":["../../../src/server/utils/source-map.ts"],"names":[],"mappings":"AAUA,UAAU,gBAAgB;IACxB,QAAQ,EAAE,MAAM,CAAC;IACjB,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,MAAM,CAAC;IACf,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB;AAED,UAAU,gBAAgB;IACxB,MAAM,EAAE,MAAM,CAAC;IACf,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,MAAM,CAAC;CAChB;AAMD;;;;GAIG;AACH,wBAAgB,eAAe,CAAC,KAAK,EAAE,MAAM,GAAG,GAAG,GAAG,gBAAgB,GAAG,IAAI,CAoD5E;AAED;;;GAGG;AACH,wBAAgB,qBAAqB,CAAC,KAAK,EAAE,MAAM,GAAG,GAAG,GAAG,gBAAgB,EAAE,CAiD7E;AAGD;;;GAGG;AACH,wBAAsB,uBAAuB,CAC3C,WAAW,EAAE,gBAAgB,EAC7B,WAAW,EAAE,MAAM,GAClB,OAAO,CAAC,gBAAgB,GAAG,IAAI,CAAC,CA8GlC;AAyKD;;;GAGG;AACH,wBAAsB,iCAAiC,CACrD,UAAU,EAAE,MAAM,GAAG,GAAG,EACxB,WAAW,EAAE,MAAM,GAClB,OAAO,CAAC,gBAAgB,GAAG,IAAI,CAAC,CAKlC"}
|
|
1
|
+
{"version":3,"file":"source-map.d.ts","sourceRoot":"","sources":["../../../src/server/utils/source-map.ts"],"names":[],"mappings":"AAUA,UAAU,gBAAgB;IACxB,QAAQ,EAAE,MAAM,CAAC;IACjB,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,MAAM,CAAC;IACf,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB;AAED,UAAU,gBAAgB;IACxB,MAAM,EAAE,MAAM,CAAC;IACf,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,MAAM,CAAC;CAChB;AAMD;;;;GAIG;AACH,wBAAgB,eAAe,CAAC,KAAK,EAAE,MAAM,GAAG,GAAG,GAAG,gBAAgB,GAAG,IAAI,CAoD5E;AAED;;;GAGG;AACH,wBAAgB,6BAA6B,CAAC,KAAK,EAAE,MAAM,GAAG,GAAG,GAAG,MAAM,GAAG,IAAI,CA+BhF;AAED;;;GAGG;AACH,wBAAgB,qBAAqB,CAAC,KAAK,EAAE,MAAM,GAAG,GAAG,GAAG,gBAAgB,EAAE,CAiD7E;AAGD;;;GAGG;AACH,wBAAsB,uBAAuB,CAC3C,WAAW,EAAE,gBAAgB,EAC7B,WAAW,EAAE,MAAM,GAClB,OAAO,CAAC,gBAAgB,GAAG,IAAI,CAAC,CA8GlC;AAyKD;;;GAGG;AACH,wBAAsB,iCAAiC,CACrD,UAAU,EAAE,MAAM,GAAG,GAAG,EACxB,WAAW,EAAE,MAAM,GAClB,OAAO,CAAC,gBAAgB,GAAG,IAAI,CAAC,CAKlC"}
|
package/dist/server.cjs
CHANGED
|
@@ -1,28 +1,30 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
|
-
const
|
|
4
|
-
exports.extractComponentName =
|
|
5
|
-
exports.
|
|
6
|
-
exports.
|
|
7
|
-
exports.
|
|
8
|
-
exports.
|
|
9
|
-
exports.
|
|
10
|
-
exports.
|
|
11
|
-
exports.
|
|
12
|
-
exports.
|
|
13
|
-
exports.
|
|
14
|
-
exports.
|
|
15
|
-
exports.
|
|
16
|
-
exports.
|
|
17
|
-
exports.
|
|
18
|
-
exports.
|
|
19
|
-
exports.
|
|
20
|
-
exports.
|
|
21
|
-
exports.
|
|
22
|
-
exports.
|
|
23
|
-
exports.
|
|
24
|
-
exports.
|
|
25
|
-
exports.
|
|
26
|
-
exports.
|
|
27
|
-
exports.
|
|
3
|
+
const comments = require("./comments-Daur80r4.cjs");
|
|
4
|
+
exports.extractComponentName = comments.extractComponentName;
|
|
5
|
+
exports.extractComponentNameFromStack = comments.extractComponentNameFromStack;
|
|
6
|
+
exports.fileExists = comments.fileExists;
|
|
7
|
+
exports.findTargetElement = comments.findTargetElement;
|
|
8
|
+
exports.getAttributeValue = comments.getAttributeValue;
|
|
9
|
+
exports.getJSXMemberName = comments.getJSXMemberName;
|
|
10
|
+
exports.getOriginalPositionFromDebugStack = comments.getOriginalPositionFromDebugStack;
|
|
11
|
+
exports.handleAIEditorRequest = comments.handleAIEditorRequest;
|
|
12
|
+
exports.handleAbsolutePath = comments.handleAbsolutePath;
|
|
13
|
+
exports.handleCommentsRequest = comments.handleCommentsRequest;
|
|
14
|
+
exports.handleEdit = comments.handleEdit;
|
|
15
|
+
exports.handleRead = comments.handleRead;
|
|
16
|
+
exports.handleResolve = comments.handleResolve;
|
|
17
|
+
exports.handleSuggestions = comments.handleSuggestions;
|
|
18
|
+
exports.handleUndo = comments.handleUndo;
|
|
19
|
+
exports.handleValidateSession = comments.handleValidateSession;
|
|
20
|
+
exports.isPathSecure = comments.isPathSecure;
|
|
21
|
+
exports.normalizePath = comments.normalizePath;
|
|
22
|
+
exports.parseDebugStack = comments.parseDebugStack;
|
|
23
|
+
exports.parseDebugStackFrames = comments.parseDebugStackFrames;
|
|
24
|
+
exports.parseFile = comments.parseFile;
|
|
25
|
+
exports.resolveFilePath = comments.resolveFilePath;
|
|
26
|
+
exports.resolveOriginalPosition = comments.resolveOriginalPosition;
|
|
27
|
+
exports.scoreElementMatch = comments.scoreElementMatch;
|
|
28
|
+
exports.validateDevMode = comments.validateDevMode;
|
|
29
|
+
exports.validateGeneratedCode = comments.validateGeneratedCode;
|
|
28
30
|
//# sourceMappingURL=server.cjs.map
|
package/dist/server.cjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"server.cjs","sources":[],"sourcesContent":[],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"server.cjs","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
package/dist/server.js
CHANGED
|
@@ -1,28 +1,30 @@
|
|
|
1
|
-
import { k,
|
|
1
|
+
import { l, w, k, o, t, q, z, h, e, i, a, b, d, g, c, f, j, n, u, x, p, r, y, s, v, m } from "./comments-D3m0RsOO.js";
|
|
2
2
|
export {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
3
|
+
l as extractComponentName,
|
|
4
|
+
w as extractComponentNameFromStack,
|
|
5
|
+
k as fileExists,
|
|
6
|
+
o as findTargetElement,
|
|
7
|
+
t as getAttributeValue,
|
|
8
|
+
q as getJSXMemberName,
|
|
9
|
+
z as getOriginalPositionFromDebugStack,
|
|
9
10
|
h as handleAIEditorRequest,
|
|
10
11
|
e as handleAbsolutePath,
|
|
12
|
+
i as handleCommentsRequest,
|
|
11
13
|
a as handleEdit,
|
|
12
14
|
b as handleRead,
|
|
13
15
|
d as handleResolve,
|
|
14
16
|
g as handleSuggestions,
|
|
15
17
|
c as handleUndo,
|
|
16
18
|
f as handleValidateSession,
|
|
17
|
-
|
|
19
|
+
j as isPathSecure,
|
|
18
20
|
n as normalizePath,
|
|
19
|
-
|
|
20
|
-
|
|
21
|
+
u as parseDebugStack,
|
|
22
|
+
x as parseDebugStackFrames,
|
|
21
23
|
p as parseFile,
|
|
22
24
|
r as resolveFilePath,
|
|
23
|
-
|
|
25
|
+
y as resolveOriginalPosition,
|
|
24
26
|
s as scoreElementMatch,
|
|
25
27
|
v as validateDevMode,
|
|
26
|
-
|
|
28
|
+
m as validateGeneratedCode
|
|
27
29
|
};
|
|
28
30
|
//# sourceMappingURL=server.js.map
|
|
@@ -0,0 +1,140 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Types for Figma-style comment system
|
|
3
|
+
*/
|
|
4
|
+
/**
|
|
5
|
+
* Simple message format for comment chat
|
|
6
|
+
*/
|
|
7
|
+
export interface CommentMessage {
|
|
8
|
+
role: "user" | "assistant";
|
|
9
|
+
content: string;
|
|
10
|
+
}
|
|
11
|
+
/**
|
|
12
|
+
* Editor mode - determines click behavior
|
|
13
|
+
*/
|
|
14
|
+
export type EditorMode = "select" | "comment" | "area" | "text";
|
|
15
|
+
/**
|
|
16
|
+
* Comment status during lifecycle
|
|
17
|
+
*/
|
|
18
|
+
export type CommentStatus = "active" | "streaming" | "done" | "error";
|
|
19
|
+
/**
|
|
20
|
+
* Types of anchors for different selection modes
|
|
21
|
+
*/
|
|
22
|
+
export type AnchorType = "coordinate" | "component" | "area" | "text";
|
|
23
|
+
/**
|
|
24
|
+
* Base point in 2D space
|
|
25
|
+
*/
|
|
26
|
+
export interface Point {
|
|
27
|
+
x: number;
|
|
28
|
+
y: number;
|
|
29
|
+
}
|
|
30
|
+
/**
|
|
31
|
+
* Coordinate-based anchor (comment mode - click anywhere)
|
|
32
|
+
*/
|
|
33
|
+
export interface CoordinateAnchor {
|
|
34
|
+
type: "coordinate";
|
|
35
|
+
x: number;
|
|
36
|
+
y: number;
|
|
37
|
+
pageX: number;
|
|
38
|
+
pageY: number;
|
|
39
|
+
}
|
|
40
|
+
/**
|
|
41
|
+
* Component-based anchor (component selection mode)
|
|
42
|
+
*/
|
|
43
|
+
export interface ComponentAnchor {
|
|
44
|
+
type: "component";
|
|
45
|
+
componentName: string;
|
|
46
|
+
filePath: string;
|
|
47
|
+
lineNumber: number;
|
|
48
|
+
elementContext?: {
|
|
49
|
+
tagName?: string;
|
|
50
|
+
className?: string;
|
|
51
|
+
textContent?: string;
|
|
52
|
+
[key: string]: any;
|
|
53
|
+
};
|
|
54
|
+
lastKnownPosition: Point;
|
|
55
|
+
}
|
|
56
|
+
/**
|
|
57
|
+
* Area-based anchor (rectangle selection)
|
|
58
|
+
*/
|
|
59
|
+
export interface AreaAnchor {
|
|
60
|
+
type: "area";
|
|
61
|
+
bounds: {
|
|
62
|
+
x: number;
|
|
63
|
+
y: number;
|
|
64
|
+
width: number;
|
|
65
|
+
height: number;
|
|
66
|
+
};
|
|
67
|
+
elements: string[];
|
|
68
|
+
}
|
|
69
|
+
/**
|
|
70
|
+
* Text-based anchor (text selection)
|
|
71
|
+
*/
|
|
72
|
+
export interface TextAnchor {
|
|
73
|
+
type: "text";
|
|
74
|
+
selectedText: string;
|
|
75
|
+
containerSelector: string;
|
|
76
|
+
startOffset: number;
|
|
77
|
+
endOffset: number;
|
|
78
|
+
}
|
|
79
|
+
/**
|
|
80
|
+
* Union type for all anchor types
|
|
81
|
+
*/
|
|
82
|
+
export type AnchorData = CoordinateAnchor | ComponentAnchor | AreaAnchor | TextAnchor;
|
|
83
|
+
/**
|
|
84
|
+
* Complete comment state
|
|
85
|
+
*/
|
|
86
|
+
export interface CommentState {
|
|
87
|
+
id: string;
|
|
88
|
+
position: Point;
|
|
89
|
+
isMinimized: boolean;
|
|
90
|
+
isDragging: boolean;
|
|
91
|
+
anchorType: AnchorType;
|
|
92
|
+
anchorData: AnchorData;
|
|
93
|
+
messages: CommentMessage[];
|
|
94
|
+
sessionId: string;
|
|
95
|
+
threadId: string;
|
|
96
|
+
status: CommentStatus;
|
|
97
|
+
createdAt: number;
|
|
98
|
+
lastActive: number;
|
|
99
|
+
}
|
|
100
|
+
/**
|
|
101
|
+
* Task history item - aggregates messages by user request
|
|
102
|
+
*/
|
|
103
|
+
export interface TaskHistoryItem {
|
|
104
|
+
id: string;
|
|
105
|
+
userRequest: string;
|
|
106
|
+
commentId: string;
|
|
107
|
+
status: "pending" | "done" | "failed";
|
|
108
|
+
actions: TaskAction[];
|
|
109
|
+
affectedFiles: string[];
|
|
110
|
+
anchorPosition?: Point;
|
|
111
|
+
createdAt: number;
|
|
112
|
+
completedAt?: number;
|
|
113
|
+
}
|
|
114
|
+
/**
|
|
115
|
+
* Individual action within a task
|
|
116
|
+
*/
|
|
117
|
+
export interface TaskAction {
|
|
118
|
+
type: "tool_use" | "result" | "error";
|
|
119
|
+
tool?: string;
|
|
120
|
+
result?: string;
|
|
121
|
+
error?: string;
|
|
122
|
+
timestamp: number;
|
|
123
|
+
}
|
|
124
|
+
/**
|
|
125
|
+
* Editor state shape
|
|
126
|
+
*/
|
|
127
|
+
export interface EditorState {
|
|
128
|
+
mode: EditorMode;
|
|
129
|
+
isPillVisible: boolean;
|
|
130
|
+
comments: Map<string, CommentState>;
|
|
131
|
+
taskHistory: TaskHistoryItem[];
|
|
132
|
+
selectedCommentId: string | null;
|
|
133
|
+
}
|
|
134
|
+
/**
|
|
135
|
+
* Serializable comment for file storage
|
|
136
|
+
*/
|
|
137
|
+
export interface SerializableComment extends Omit<CommentState, "messages"> {
|
|
138
|
+
messages: any[];
|
|
139
|
+
}
|
|
140
|
+
//# sourceMappingURL=comment-types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"comment-types.d.ts","sourceRoot":"","sources":["../../src/shared/comment-types.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH;;GAEG;AACH,MAAM,WAAW,cAAc;IAC7B,IAAI,EAAE,MAAM,GAAG,WAAW,CAAC;IAC3B,OAAO,EAAE,MAAM,CAAC;CACjB;AAED;;GAEG;AACH,MAAM,MAAM,UAAU,GAAG,QAAQ,GAAG,SAAS,GAAG,MAAM,GAAG,MAAM,CAAC;AAEhE;;GAEG;AACH,MAAM,MAAM,aAAa,GAAG,QAAQ,GAAG,WAAW,GAAG,MAAM,GAAG,OAAO,CAAC;AAEtE;;GAEG;AACH,MAAM,MAAM,UAAU,GAAG,YAAY,GAAG,WAAW,GAAG,MAAM,GAAG,MAAM,CAAC;AAEtE;;GAEG;AACH,MAAM,WAAW,KAAK;IACpB,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;CACX;AAED;;GAEG;AACH,MAAM,WAAW,gBAAgB;IAC/B,IAAI,EAAE,YAAY,CA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@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "next-ai-editor",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.2.0",
|
|
4
4
|
"description": "AI-powered React component editor for Next.js - edit your components with natural language in development mode",
|
|
5
5
|
"author": "Jesse Halpern",
|
|
6
6
|
"type": "module",
|
|
@@ -22,7 +22,8 @@
|
|
|
22
22
|
"types": "./dist/server/index.d.ts",
|
|
23
23
|
"import": "./dist/server.js",
|
|
24
24
|
"require": "./dist/server.cjs"
|
|
25
|
-
}
|
|
25
|
+
},
|
|
26
|
+
"./styles": "./dist/next-ai-editor.css"
|
|
26
27
|
},
|
|
27
28
|
"files": [
|
|
28
29
|
"dist",
|
|
@@ -35,6 +36,7 @@
|
|
|
35
36
|
"react-dom": ">=18.0.0"
|
|
36
37
|
},
|
|
37
38
|
"dependencies": {
|
|
39
|
+
"@anthropic-ai/claude-agent-sdk": "^0.2.3",
|
|
38
40
|
"@babel/parser": "^7.26.3",
|
|
39
41
|
"@babel/traverse": "^7.26.5",
|
|
40
42
|
"@babel/types": "^7.26.5",
|
|
@@ -42,12 +44,17 @@
|
|
|
42
44
|
"@langchain/anthropic": "^0.3.15",
|
|
43
45
|
"@langchain/core": "^0.3.58",
|
|
44
46
|
"@types/react-syntax-highlighter": "^15.5.13",
|
|
45
|
-
"
|
|
47
|
+
"eventsource-parser": "^3.0.6",
|
|
48
|
+
"nanoid": "^5.0.9",
|
|
49
|
+
"react-markdown": "^10.1.0",
|
|
50
|
+
"react-syntax-highlighter": "^16.1.0",
|
|
51
|
+
"remark-gfm": "^4.0.1"
|
|
46
52
|
},
|
|
47
53
|
"devDependencies": {
|
|
48
54
|
"@types/babel__traverse": "^7.20.6",
|
|
49
55
|
"@types/node": "^20.0.0",
|
|
50
56
|
"@types/react": "^19.0.0",
|
|
57
|
+
"lucide-react": "^0.562.0",
|
|
51
58
|
"typescript": "^5.7.2",
|
|
52
59
|
"vite": "^6.0.7",
|
|
53
60
|
"vite-plugin-dts": "^4.5.0"
|
|
@@ -82,6 +89,8 @@
|
|
|
82
89
|
"scripts": {
|
|
83
90
|
"dev": "vite build --watch",
|
|
84
91
|
"build": "vite build && tsc --emitDeclarationOnly --declaration --declarationDir dist",
|
|
85
|
-
"typecheck": "tsc --noEmit"
|
|
92
|
+
"typecheck": "tsc --noEmit",
|
|
93
|
+
"clean": "rm -rf dist",
|
|
94
|
+
"test:agent": "tsx test-agent.ts"
|
|
86
95
|
}
|
|
87
96
|
}
|