@patchedcodes/hackathon-widget 0.1.2 → 0.1.4
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 +101 -6
- package/dist/devloyed-widget.js +1178 -1019
- package/dist/devloyed-widget.js.map +1 -1
- package/dist/index.d.ts +13 -22
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -44,19 +44,10 @@ export declare interface ChatMessage {
|
|
|
44
44
|
* The payload sent to the backend when the user issues a command.
|
|
45
45
|
*/
|
|
46
46
|
export declare interface CommandRequest {
|
|
47
|
-
/**
|
|
48
|
-
|
|
49
|
-
/**
|
|
50
|
-
|
|
51
|
-
/** Viewport dimensions */
|
|
52
|
-
viewport: {
|
|
53
|
-
width: number;
|
|
54
|
-
height: number;
|
|
55
|
-
};
|
|
56
|
-
/** Project identifier */
|
|
57
|
-
projectId: string;
|
|
58
|
-
/** Optional conversation context for multi-turn editing */
|
|
59
|
-
conversationId?: string;
|
|
47
|
+
/** API key for authenticating with the backend */
|
|
48
|
+
apiKey: string;
|
|
49
|
+
/** The user's natural language prompt */
|
|
50
|
+
prompt: string;
|
|
60
51
|
}
|
|
61
52
|
|
|
62
53
|
/**
|
|
@@ -64,12 +55,12 @@ export declare interface CommandRequest {
|
|
|
64
55
|
* The backend only responds once the deploy is complete.
|
|
65
56
|
*/
|
|
66
57
|
export declare interface CommandResponse {
|
|
58
|
+
/** The commit SHA that was pushed to main */
|
|
59
|
+
commitId: string;
|
|
67
60
|
/** AI's explanation of what was changed */
|
|
68
|
-
|
|
69
|
-
/**
|
|
70
|
-
|
|
71
|
-
/** The URL where the changes are live (may be same domain) */
|
|
72
|
-
previewUrl?: string;
|
|
61
|
+
transcript: string;
|
|
62
|
+
/** Short descriptive commit message for the changes */
|
|
63
|
+
commitMessage: string;
|
|
73
64
|
}
|
|
74
65
|
|
|
75
66
|
/**
|
|
@@ -191,7 +182,7 @@ export declare class DevloyedWidget extends HTMLElement {
|
|
|
191
182
|
*
|
|
192
183
|
* init({
|
|
193
184
|
* endpoint: 'https://api.devloyed.com/command',
|
|
194
|
-
*
|
|
185
|
+
* apiKey: 'your-api-key',
|
|
195
186
|
* position: 'bottom-right',
|
|
196
187
|
* theme: 'light',
|
|
197
188
|
* });
|
|
@@ -202,7 +193,7 @@ export declare function init(config: WidgetConfig): DevloyedWidget;
|
|
|
202
193
|
/**
|
|
203
194
|
* Internal resolved configuration with defaults applied.
|
|
204
195
|
*/
|
|
205
|
-
export declare interface ResolvedConfig extends Required<Pick<WidgetConfig, "endpoint" | "
|
|
196
|
+
export declare interface ResolvedConfig extends Required<Pick<WidgetConfig, "endpoint" | "apiKey" | "position" | "theme">> {
|
|
206
197
|
headers: Record<string, string>;
|
|
207
198
|
onDeployReady?: (branch: string, previewUrl: string) => void;
|
|
208
199
|
onError?: (error: Error) => void;
|
|
@@ -241,8 +232,8 @@ export declare class TransportClient {
|
|
|
241
232
|
export declare interface WidgetConfig {
|
|
242
233
|
/** Backend endpoint URL for sending commands (POST) */
|
|
243
234
|
endpoint: string;
|
|
244
|
-
/**
|
|
245
|
-
|
|
235
|
+
/** API key sent in the request body to authenticate with the backend */
|
|
236
|
+
apiKey: string;
|
|
246
237
|
/** Position of the floating widget button */
|
|
247
238
|
position?: "bottom-right" | "bottom-left" | "top-right" | "top-left";
|
|
248
239
|
/** Widget color theme */
|
package/package.json
CHANGED