Skip to content

Commit 3da8e03

Browse files
committed
Publish version v0.2.25
1 parent e3fbe34 commit 3da8e03

File tree

5 files changed

+21
-13
lines changed

5 files changed

+21
-13
lines changed

apps/studio/electron/main/chat/trainloop.ts

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import { BASE_PROXY_ROUTE, FUNCTIONS_ROUTE, ProxyRoutes } from '@onlook/models/constants';
2-
import { Client, SampleFeedbackType, type Message } from '@trainloop/sdk';
2+
import { Client, SampleFeedbackType } from '@trainloop/sdk';
3+
import type { CoreMessage } from 'ai';
34
import { getRefreshedAuthTokens } from '../auth';
45

56
class TrainLoopManager {
@@ -23,9 +24,13 @@ class TrainLoopManager {
2324
return TrainLoopManager.instance;
2425
}
2526

26-
public async saveApplyResult(messages: Message[], type: SampleFeedbackType) {
27+
public async saveApplyResult(messages: CoreMessage[], type: SampleFeedbackType) {
2728
const client = await this.getClient();
28-
await client.sendData(messages, type as string, 'onlook-apply-set');
29+
await client.sendData(
30+
messages as unknown as Record<string, string>[],
31+
type,
32+
'onlook-apply-set',
33+
);
2934
}
3035
}
3136

apps/studio/electron/main/events/chat.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import type { ChatConversation, ProjectSuggestions } from '@onlook/models/chat';
22
import { StreamRequestType } from '@onlook/models/chat';
33
import { MainChannels } from '@onlook/models/constants';
44
import type { SampleFeedbackType } from '@trainloop/sdk';
5-
import type { CoreMessage, Message } from 'ai';
5+
import type { CoreMessage } from 'ai';
66
import { ipcMain } from 'electron';
77
import Chat from '../chat';
88
import trainloop from '../chat/trainloop';
@@ -74,7 +74,7 @@ export function listenForChatMessages() {
7474
});
7575

7676
ipcMain.handle(MainChannels.SAVE_APPLY_RESULT, (e, args) => {
77-
const { type, messages } = args as { type: SampleFeedbackType; messages: Message[] };
77+
const { type, messages } = args as { messages: CoreMessage[]; type: SampleFeedbackType };
7878
return trainloop.saveApplyResult(messages, type);
7979
});
8080
}

apps/studio/src/lib/editor/engine/chat/code.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,8 @@ import { ChatMessageRole, type AssistantChatMessage, type CodeBlock } from '@onl
55
import type { CodeDiff } from '@onlook/models/code';
66
import { MainChannels } from '@onlook/models/constants';
77
import { toast } from '@onlook/ui/use-toast';
8-
import { SampleFeedbackType, type Message } from '@trainloop/sdk';
8+
import { SampleFeedbackType } from '@trainloop/sdk';
9+
import type { CoreMessage } from 'ai';
910
import { makeAutoObservable } from 'mobx';
1011
import type { ChatManager } from '.';
1112
import type { EditorEngine } from '..';
@@ -92,7 +93,7 @@ export class ChatCodeManager {
9293
sendAnalytics('apply code change');
9394
}
9495

95-
saveApplyResult(message: Message, type: SampleFeedbackType) {
96+
saveApplyResult(message: CoreMessage, type: SampleFeedbackType) {
9697
invokeMainChannel(MainChannels.SAVE_APPLY_RESULT, { type, messages: [message] });
9798
}
9899

bun.lock

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,9 @@
33
"workspaces": {
44
"": {
55
"name": "@onlook/repo",
6+
"dependencies": {
7+
"@trainloop/sdk": "^0.1.8",
8+
},
69
"devDependencies": {
710
"extract-zip": "^2.0.1",
811
"husky": "^9.1.6",
@@ -1693,7 +1696,7 @@
16931696

16941697
"foreground-child": ["[email protected]", "", { "dependencies": { "cross-spawn": "^7.0.6", "signal-exit": "^4.0.1" } }, "sha512-gIXjKqtFuWEgzFRJA9WCQeSJLZDjgJUOMCMzxtvFq/37KojM1BFGufqsCy0r4qSQmYLsZYMeyRqzIWOMup03sw=="],
16951698

1696-
"form-data": ["form-data@2.5.3", "", { "dependencies": { "asynckit": "^0.4.0", "combined-stream": "^1.0.8", "es-set-tostringtag": "^2.1.0", "mime-types": "^2.1.35", "safe-buffer": "^5.2.1" } }, "sha512-XHIrMD0NpDrNM/Ckf7XJiBbLl57KEhT3+i3yY+eWm+cqYZJQTZrKo8Y8AWKnuV5GT4scfuUGt9LzNoIx3dU1nQ=="],
1699+
"form-data": ["form-data@4.0.2", "", { "dependencies": { "asynckit": "^0.4.0", "combined-stream": "^1.0.8", "es-set-tostringtag": "^2.1.0", "mime-types": "^2.1.12" } }, "sha512-hGfm/slu0ZabnNt4oaRZ6uREyfCj6P4fT/n6A1rGV+Z0VdGXjfOhVUpkn6qVQONHGIFwmveGXyDs75+nr6FM8w=="],
16971700

16981701
"form-data-encoder": ["[email protected]", "", {}, "sha512-qfqtYan3rxrnCk1VYaA4H+Ms9xdpPqvLZa6xmMgFvhO32x7/3J/ExcTd6qpxM0vH2GdMI+poehyBZvqfMTto8A=="],
16991702

@@ -3053,7 +3056,7 @@
30533056

30543057
"@ts-morph/common/minimatch": ["[email protected]", "", { "dependencies": { "brace-expansion": "^2.0.1" } }, "sha512-G6T0ZX48xgozx7587koeX9Ys2NYy6Gmv//P89sEte9V9whIapMNF4idKxnW2QtCcLiTWlb/wfCabAtAFWhhBow=="],
30553058

3056-
"@types/node-fetch/form-data": ["form-data@4.0.2", "", { "dependencies": { "asynckit": "^0.4.0", "combined-stream": "^1.0.8", "es-set-tostringtag": "^2.1.0", "mime-types": "^2.1.12" } }, "sha512-hGfm/slu0ZabnNt4oaRZ6uREyfCj6P4fT/n6A1rGV+Z0VdGXjfOhVUpkn6qVQONHGIFwmveGXyDs75+nr6FM8w=="],
3059+
"@types/got/form-data": ["form-data@2.5.3", "", { "dependencies": { "asynckit": "^0.4.0", "combined-stream": "^1.0.8", "es-set-tostringtag": "^2.1.0", "mime-types": "^2.1.35", "safe-buffer": "^5.2.1" } }, "sha512-XHIrMD0NpDrNM/Ckf7XJiBbLl57KEhT3+i3yY+eWm+cqYZJQTZrKo8Y8AWKnuV5GT4scfuUGt9LzNoIx3dU1nQ=="],
30573060

30583061
"@typescript-eslint/eslint-plugin/ignore": ["[email protected]", "", {}, "sha512-hsBTNUqQTDwkWtcdYI2i06Y/nUBEsNEDJKjWdigLvegy8kDuJAS8uRlpkkcQpyEXL0Z/pjDy5HBmMjRCJ2gq+g=="],
30593062

@@ -3063,8 +3066,6 @@
30633066

30643067
"anymatch/picomatch": ["[email protected]", "", {}, "sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA=="],
30653068

3066-
"app-builder-lib/form-data": ["[email protected]", "", { "dependencies": { "asynckit": "^0.4.0", "combined-stream": "^1.0.8", "es-set-tostringtag": "^2.1.0", "mime-types": "^2.1.12" } }, "sha512-hGfm/slu0ZabnNt4oaRZ6uREyfCj6P4fT/n6A1rGV+Z0VdGXjfOhVUpkn6qVQONHGIFwmveGXyDs75+nr6FM8w=="],
3067-
30683069
"app-builder-lib/minimatch": ["[email protected]", "", { "dependencies": { "brace-expansion": "^2.0.1" } }, "sha512-ethXTt3SGGR+95gudmqJ1eNhRO7eGEGIgYA9vnPatK4/etz2MEVDno5GMCibdMTuBMyElzIlgxMna3K94XDIDQ=="],
30693070

30703071
"app-builder-lib/semver": ["[email protected]", "", { "bin": { "semver": "bin/semver.js" } }, "sha512-hlq8tAfn0m/61p4BVRcPzIGr6LKiMwo4VM6dGi6pt4qcRkmNzTcWq6eCEjEh+qXjkMDvPlOFFSGwQjoEa6gyMA=="],
@@ -3079,8 +3080,6 @@
30793080

30803081
"archiver-utils/readable-stream": ["[email protected]", "", { "dependencies": { "core-util-is": "~1.0.0", "inherits": "~2.0.3", "isarray": "~1.0.0", "process-nextick-args": "~2.0.0", "safe-buffer": "~5.1.1", "string_decoder": "~1.1.1", "util-deprecate": "~1.0.1" } }, "sha512-8p0AUk4XODgIewSi0l8Epjs+EVnWiK7NoDIEGU0HhE7+ZyY8D1IMY7odu5lRrFXGg71L15KG8QrPmum45RTtdA=="],
30813082

3082-
"axios/form-data": ["[email protected]", "", { "dependencies": { "asynckit": "^0.4.0", "combined-stream": "^1.0.8", "es-set-tostringtag": "^2.1.0", "mime-types": "^2.1.12" } }, "sha512-hGfm/slu0ZabnNt4oaRZ6uREyfCj6P4fT/n6A1rGV+Z0VdGXjfOhVUpkn6qVQONHGIFwmveGXyDs75+nr6FM8w=="],
3083-
30843083
"babel-plugin-macros/cosmiconfig": ["[email protected]", "", { "dependencies": { "@types/parse-json": "^4.0.0", "import-fresh": "^3.2.1", "parse-json": "^5.0.0", "path-type": "^4.0.0", "yaml": "^1.10.0" } }, "sha512-AdmX6xUzdNASswsFtmwSt7Vj8po9IuqXm0UXz7QKPuEUmPB4XyjGfaAr2PSuELMwkRMVH1EpIkX5bTZGRB3eCA=="],
30853084

30863085
"babel-plugin-macros/resolve": ["[email protected]", "", { "dependencies": { "is-core-module": "^2.16.0", "path-parse": "^1.0.7", "supports-preserve-symlinks-flag": "^1.0.0" }, "bin": { "resolve": "bin/resolve" } }, "sha512-NPRy+/ncIMeDlTAsuqwKIiferiawhefFJtkNSW0qZJEqMEb+qBt/77B/jGeeek+F0uOeN05CDa6HXbbIgtVX4w=="],

package.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,5 +48,8 @@
4848
"devDependencies": {
4949
"extract-zip": "^2.0.1",
5050
"husky": "^9.1.6"
51+
},
52+
"dependencies": {
53+
"@trainloop/sdk": "^0.1.8"
5154
}
5255
}

0 commit comments

Comments
 (0)