@patchedcodes/hackathon-widget 0.1.2 → 0.1.3

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/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
- /** The user's natural language command */
48
- command: string;
49
- /** Base64-encoded screenshot of the current page */
50
- screenshot: string;
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,10 @@ 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
- message: string;
69
- /** The branch name that was deployed */
70
- branch?: string;
71
- /** The URL where the changes are live (may be same domain) */
72
- previewUrl?: string;
61
+ transcript: string;
73
62
  }
74
63
 
75
64
  /**
@@ -192,6 +181,7 @@ export declare class DevloyedWidget extends HTMLElement {
192
181
  * init({
193
182
  * endpoint: 'https://api.devloyed.com/command',
194
183
  * projectId: 'my-project',
184
+ * apiKey: 'your-api-key',
195
185
  * position: 'bottom-right',
196
186
  * theme: 'light',
197
187
  * });
@@ -202,7 +192,7 @@ export declare function init(config: WidgetConfig): DevloyedWidget;
202
192
  /**
203
193
  * Internal resolved configuration with defaults applied.
204
194
  */
205
- export declare interface ResolvedConfig extends Required<Pick<WidgetConfig, "endpoint" | "projectId" | "position" | "theme">> {
195
+ export declare interface ResolvedConfig extends Required<Pick<WidgetConfig, "endpoint" | "projectId" | "apiKey" | "position" | "theme">> {
206
196
  headers: Record<string, string>;
207
197
  onDeployReady?: (branch: string, previewUrl: string) => void;
208
198
  onError?: (error: Error) => void;
@@ -243,6 +233,8 @@ export declare interface WidgetConfig {
243
233
  endpoint: string;
244
234
  /** Project identifier — sent with each request so the backend knows which repo to modify */
245
235
  projectId: string;
236
+ /** API key sent in the request body to authenticate with the backend */
237
+ apiKey: string;
246
238
  /** Position of the floating widget button */
247
239
  position?: "bottom-right" | "bottom-left" | "top-right" | "top-left";
248
240
  /** Widget color theme */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@patchedcodes/hackathon-widget",
3
- "version": "0.1.2",
3
+ "version": "0.1.3",
4
4
  "description": "AI-powered frontend editor widget — modify live web interfaces using natural language",
5
5
  "type": "module",
6
6
  "main": "./dist/devloyed-widget.js",