Commit Graph

469 Commits

Author SHA1 Message Date
Mihovil Ilakovac
633e25c125
Injected auth models (#1583) 2024-01-03 14:40:08 +01:00
Janko Vidaković
e41fc5792c
Fix import/export JS errors in Mage (#1607) 2024-01-02 16:43:35 +01:00
Martin Šošić
994a58f0dc
Wasp ai cli mage (#1601)
* Improved Wasp AI CLI experience.

* fix

* Added CLI Usage, polished CLI commands.

* Added choice of temperature.

* Added styling.

* Added more sophisticated, terminal-only styling.

* fix

* Updated Mage to use new Wasp CLI + added some messaging to CLI.

* fix

* Created wasp-ai/README, updated waspc/README.

* Moved wasp-ai/ to mage/.

* Final polishing (docs, readmes, messaging).

* fix

* Added tests for LogMsg.

* Updated versions of test apps to 0.12.

* fix

* fix

* Update mage/README.md

* fix

* fix
2023-12-22 15:14:38 +01:00
Janko Vidaković
34f6539590
Support more GPT models in Mage + allow customizing both of them (#1598)
* Enable new OpenAI models for MAGE

* Add option to specify Plan GPT model from CLI

* Fix error in parsing planGptModel

* Remove check for GPT-4 availability

* Refactor initialization of GPT params

* Add GPT 3.5 Turbo 0613

* Fix GPT versions to exact values

Generic OpenAI models, such as 'GPT-4' and 'GPT-3_5_turbo',
point to the 'latest' of the respective OpenAI models.
This means that the exact models used can change unexpectedly.
This would not normally be an issue, but the newer models
tend to exhibit a performance drop.
Therefore, to future-proof our application, we fix the
model versions to prevent any unexpected model changes.

* Rename base->coding, plan->planning

* Remove unused _useGpt3IfGpt4NotAvailable field

* Remove confusing helper function

* Fix typo Planing -> Planning
2023-12-13 17:11:08 +01:00
Martin Sosic
47c4b8cb16 Merge branch 'main' into wasp-ai 2023-12-11 20:19:46 +01:00
Mihovil Ilakovac
ef6d6b1041
Username validation refactor (#1569) 2023-11-15 13:05:00 +01:00
Mihovil Ilakovac
4db82bf815
Escape Prisma command when running with script on Linux (#1561) 2023-11-14 13:32:15 +01:00
Mihovil Ilakovac
62aa2b72c4
Adjust the DB check error message (#1558) 2023-11-09 13:19:47 +01:00
Mihovil Ilakovac
96ea796067
Add check if migrations dir exists before copying (#1562) 2023-11-09 13:17:45 +01:00
Ikko Eltociear Ashimine
2b47abd36f
Fix typo in Token.hs (#1496)
accomodate -> accommodate

Co-authored-by: Filip Sodić <filip.sodic@fer.hr>
2023-11-06 12:43:17 +01:00
Mihovil Ilakovac
0f6ca6de5f
Fixes timeouts for Mage (#1555) 2023-11-02 13:31:05 +01:00
Mihovil Ilakovac
520c35af5c
Adds support for client subdir (#1516) 2023-10-27 15:12:47 +02:00
Mihovil Ilakovac
e871e048fb
Fixes a Prisma SSL bug by bumping Prisma (#1544) 2023-10-27 12:47:25 +02:00
Ritik Raj
b26ca1dc33
updated SQLite to PostgreSQL migration doc's link (#1517) 2023-10-19 15:16:07 +02:00
Mihovil Ilakovac
03cfcdfaaf
Wasp Studio [experimental] (#1483) 2023-10-10 12:17:05 +02:00
Mihovil Ilakovac
88d9534fd3
Allow customising the Vite config (#1465) 2023-10-09 15:40:33 +02:00
Mihovil Ilakovac
16fa3bd487 Merge branch 'main' into wasp-ai 2023-09-14 12:23:29 +02:00
Mihovil Ilakovac
99c9021f82
Signup Customisation [RFC] (#1395) 2023-09-12 13:19:47 +02:00
Mihovil Ilakovac
cb88dfc618
Adding support for Postgres Extensions (#1443) 2023-09-12 13:03:57 +02:00
Mihovil Ilakovac
092ff2acaf
Type safe async jobs (#1400) 2023-09-07 16:32:55 +02:00
Mihovil Ilakovac
792c014551
Implement type safe links (#1235) 2023-08-30 14:40:17 +02:00
Mihovil Ilakovac
b34ab5dc8b
Fixes .env.client copying (#1391) 2023-08-10 11:20:33 +02:00
Craig McIlwrath
ea70a8e4bb
[waspls] fix client directory module resolution (#1372)
Previously, waspls incorrectly thought that importing `@client/file.jsx` could be referencing the file `src/client/file.tsx`. But this JS/TS "merging" is only correct on the server (for reasons that are not explained by the TS documentation on module resolution). This commit fixes that by requiring exact matches for external imports beginning with `@client`.

This incorrect behavior manifested as several different bugs:
- Not reporting missing `.jsx` files when a `.tsx` file with the same name exists.
- Go-to definition going to the `.tsx` file instead of the `.jsx` file when the external import ends in `.jsx`.
- Scaffold actions suggestions scaffolding in both the `.jsx` and `.tsx`files.

This commit fixes all of these buggy behaviors.
2023-07-28 10:49:09 -04:00
Craig McIlwrath
76d9fc4213
[waspls] Add code actions for scaffolding external code (#1316)
When an external import tries to import a symbol from a TypeScript/JavaScript file, waspls now offers quickfix code actions to scaffold a function in that file.

It uses the surrounding context of the external import to determine what code to write for the code action. See [`ScaffoldTsSymbol.hs`](457911d5e9/waspc/waspls/src/Wasp/LSP/Commands/ScaffoldTsSymbol.hs) for a detailed description of how it works. At a high level, there is a `templateForFile` function in `Wasp.LSP.Commands.ScaffoldTsSymbol` that selects the correct template from `data/lsp/templates/ts`. For example, `action.fn.ts` contains a template for scaffolding an `action` function in a TypeScript file and would be used when a code action is requested with the cursor at the location marked by `|`:

```wasp
action createTask {
  fn: import { createTask } from "@server/actions.js"|
}
```

The scaffold action runs as a [LSP command](https://microsoft.github.io/language-server-protocol/specifications/specification-3-16/#workspace_executeCommand). To prepare for wanting to define more commands in waspls in the future, this PR also introduces the concept of `Commands` (`Wasp.LSP.Commands.Command`) that define some properties about each command waspls wants to handle.
2023-07-26 08:00:16 -04:00
Craig McIlwrath
8b1d6a96ab
[waspls] implement goto definition for declarations (#1310) 2023-07-18 08:16:26 -04:00
Filip Sodić
ba683d0969 Add extendedWhereUnique to Wasp AI 2023-07-12 17:51:33 +02:00
Filip Sodić
4bff9069a3 Merge branch 'main' into wasp-ai 2023-07-12 17:44:24 +02:00
Filip Sodić
af9d7992b3
Add support for Prisma preview features (#1315) 2023-07-12 17:08:57 +02:00
Martin Sosic
803fad6d9f Added creativity level, improved messaging in wasp-ai, some links. 2023-07-12 16:18:57 +02:00
Filip Sodić
e2ed9682e0 Merge branch 'wasp-ai' of github.com:wasp-lang/wasp into wasp-ai 2023-07-11 13:27:44 +02:00
Filip Sodić
ce5f292cca Improve Page examples for chat gpt 2023-07-11 13:27:32 +02:00
Martin Sosic
805aaef1dd Temperature can now be adjusted via CLI. 2023-07-11 12:38:32 +02:00
Martin Sosic
737ab428ed Added GPT4 as an option via project config JSON. 2023-07-11 12:28:19 +02:00
Filip Sodić
2eb648ce01 Tell Chat GPT to improve page design 2023-07-10 18:26:25 +02:00
Filip Sodić
72f6b08c99 Enrich example page with styles and logic 2023-07-10 17:57:22 +02:00
Martin Sosic
4f8a448dc9 Gave it examples on what to avoid regarding update() and findUnique(). 2023-07-10 15:48:02 +02:00
Martin Sosic
dcf6001623 Explained to GPT not to use multiple fields in the 'where' of update() or findUnique(). 2023-07-10 11:15:01 +02:00
Martin Sosic
81257bb179 Updated action example to not use updateMany as it confused GPT. 2023-07-08 21:40:24 +02:00
Martin Sosic
1d8d47c028 Added logout button to Layout.jsx. 2023-07-08 21:13:55 +02:00
Martin Sosic
248ee950bd Removed list of all possible imports from Page prompts. 2023-07-08 20:30:44 +02:00
Filip Sodić
0cc65dbd3e
Add import heuristic (#1311) 2023-07-08 01:26:54 +02:00
Martin Sosic
a321684959 Login/Signup page now have nice width. 2023-07-07 17:46:30 +02:00
Martin Sosic
ef66f0e991 Told it to replace local js imports with actual implementation. 2023-07-07 16:09:32 +02:00
Martin Sosic
e3f09be9ae Wasp AI: small fixes. 2023-07-07 15:46:43 +02:00
Martin Sosic
64163763e3 Wasp AI: Plan is not repeatedly fixed. 2023-07-07 15:21:10 +02:00
Craig McIlwrath
2d3f0e116c
[waspls] cleanup extimport code (#1292)
mainly refactoring. also updates CI workflow to run packages/ts-inspect tests.
2023-07-07 08:21:33 -04:00
Martin Sosic
d2e5007a0a Wasp AI: Told GPT we are using sqlite so it can't do String[] in PSL. 2023-07-07 12:11:53 +02:00
Filip Sodić
352476e6e3
Fix Wasp AI import and login/logout problems (#1308) 2023-07-07 12:06:24 +02:00
Martin Šošić
4d4c2c2f72
Wasp AI: got prisma format working, fixed recovery on http errors
* Put some skeleton logic in.

* Fixed wrong handling of http errors, got prisma format working.

* fix
2023-07-07 01:24:26 +02:00
Martin Sosic
f714b8eb1d Added prisma TS package to Wasp, for running prisma format. 2023-07-06 18:29:02 +02:00
Martin Sosic
a7254cadb7 Code agent now sends the exception that crashed it as the last log. 2023-07-05 19:03:48 +02:00
Martin Sosic
42d656d9ad Added logs when retrying GPT requests. 2023-07-05 18:24:42 +02:00
Martin Sosic
513d696337 Fixed wrong http error handling. 2023-07-05 17:40:45 +02:00
Filip Sodić
0551983d5f Prevent chat gpt from generating login and signup 2023-07-05 16:23:04 +02:00
Filip Sodić
023478498c Fix typo in actions 2023-07-05 14:05:18 +02:00
Filip Sodić
cd0c5cb1bb
Fix incorrect import and useAction hook usage (#1305) 2023-07-05 11:57:54 +02:00
Martin Sosic
312441579a Improved code a bit for retrying GPT requests. 2023-07-05 01:00:18 +02:00
Martin Sosic
f22e7a87c6 Made ChatGPT retrying more robust (reacts to more http status codes). 2023-07-04 22:32:23 +02:00
Martin Sosic
0d58f24266 Reduced duration and tokens for JSON fixing, fixed removing double imports in operations. 2023-06-30 16:46:17 +02:00
Martin Sosic
b54627bc6e Made Wasp AI even more resistant to invalid JSON being returned from GPT. 2023-06-30 14:45:09 +02:00
Martin Sosic
046a49b709 Improved how we choose to use ChatGPT4. 2023-06-30 02:13:26 +02:00
Martin Sosic
958807f25b Now we use GPT4, if available, for plan. 2023-06-30 01:49:42 +02:00
Mihovil Ilakovac
f6cd3c79fd Use custom color 2023-06-29 22:36:03 +02:00
Martin Sosic
a5323a2e05 Added JSON config via CLI for Wasp AI. 2023-06-29 21:25:23 +02:00
Martin Sosic
005c17cef6 fix 2023-06-29 19:49:57 +02:00
Martin Sosic
cd4563f1e7 Some more prompt fixes. 2023-06-29 19:35:27 +02:00
Martin Sosic
bc3ac4e894 Improved some prompts. 2023-06-29 19:35:27 +02:00
Martin Sosic
84bda360b1 small fix of 403 http status to 401. 2023-06-29 16:56:55 +02:00
Martin Sosic
32c1f08a98 Enriched Operation examples. 2023-06-29 16:53:48 +02:00
Martin Šošić
3b6b6ddf1a
Wasp ai fuller examples (#1300)
* Enriched main.wasp example.

* Enriched examples in the prompts for Plan and for Wasp file.
2023-06-29 15:55:07 +02:00
Mihovil Ilakovac
c209077d20 Page fixing update 2023-06-29 15:32:40 +02:00
Mihovil Ilakovac
88a8f6a2ef Updates prompts: pages fixing, operations fixing 2023-06-29 15:12:48 +02:00
Mihovil Ilakovac
3e6e89d4e3 Adds pages fixing. Improve JSON fixing prompt. 2023-06-29 14:36:55 +02:00
Martin Sosic
20c06bc9e7 fix 2023-06-29 14:00:33 +02:00
Martin Sosic
f989bd7fca Now we do multiple attempts to fix wasp file if there are compile errors left. 2023-06-29 13:36:50 +02:00
Martin Sosic
d553f29f70 Merge branch 'main' into wasp-ai 2023-06-29 12:46:05 +02:00
Craig McIlwrath
c1d86b1f91
Show multiple parse errors from Wasp Analyzer (#1298)
* allow multiple errors to come out of analyzer

basically just plumbing. does add one new thing: all the concrete parse
errors get reported now 🥳

* add statement level error recovery to abstract parser

* add expression level parse recovery

recovers from errors inside dict entries, lists,
and tuples.

* document parser error recovery

* run formatter
2023-06-29 12:34:31 +02:00
Mihovil Ilakovac
a2a41ea0a0 Fixes imports example 2023-06-29 00:23:37 +02:00
Mihovil Ilakovac
7caf367d41 Adds Tailwind support. Small prompt adjustments. 2023-06-28 23:40:00 +02:00
Martin Sosic
302936bf7f Added reporting of tokens usage. 2023-06-28 23:19:06 +02:00
Martin Sosic
08c235d12e Added fixing of NodeJS operations files. 2023-06-28 22:04:57 +02:00
Martin Sosic
286117b404 Added fixing of individual Operations. 2023-06-28 20:28:37 +02:00
Martin Sosic
cf8877479c Small fix of plan fixing. 2023-06-28 17:11:33 +02:00
Martin Sosic
1d6277846b Implemented fixing of Wasp file. 2023-06-28 16:48:22 +02:00
Martin Sosic
5d13b4d607 tiny plan fixing fix. 2023-06-28 11:40:33 +02:00
Martin Šošić
6c2049ad5a
Added plan fixing. (#1296) 2023-06-28 09:42:08 +02:00
Martin Sosic
349875b242 Upped number of retries for JSON from 1 to 2. Added pretty debugging of chatGPT prompts. 2023-06-27 18:24:12 +02:00
Martin Šošić
69129df3ce
If chatGPT responds with invalid JSON, ask it to fix it. (#1293) 2023-06-27 16:03:06 +02:00
Martin Šošić
466e33d50c
Wasp ai retry (#1288)
* Wasp AI now retries requests to chat GPT.

* Improved retry.

* Got tests for retry working.

* one more test.

* Improved retry tests a bit.

* Finished tests.

* fix
2023-06-26 17:48:08 +02:00
Martin Sosic
001068ca1a Merge branch 'main' into wasp-ai 2023-06-23 12:45:59 +02:00
Martin Sosic
83ef006a98 Improved messaging for missing OpenAI Api key. 2023-06-23 12:09:09 +02:00
Craig McIlwrath
7c0d13d242
[waspls] diagnostics for external imports and goto definition (#1268) 2023-06-22 15:37:07 -04:00
Craig McIlwrath
066b832127
Adjust how dictionary types are displayed (#1280) 2023-06-22 14:13:18 -04:00
Martin Sosic
cfa09771e1 Merge branch 'main' into wasp-ai 2023-06-21 11:06:45 +02:00
Martin Sosic
98fa699011 Fix with non-optional jsImports field that should have been optional. 2023-06-21 11:01:31 +02:00
Craig McIlwrath
802e0c5e5d
show error message when database is not running (#1218)
Co-authored-by: Martin Šošić <Martinsos@users.noreply.github.com>
Co-authored-by: Mihovil Ilakovac <mihovil@ilakovac.com>
2023-06-20 14:34:14 -04:00
Martin Sosic
2e9a33d167 Extracted core skeleton files from the local template(s). 2023-06-20 19:58:15 +02:00
Martin Sosic
2379877b14 Removed debugging output. 2023-06-20 18:37:36 +02:00
Martin Sosic
6d4a39a976 Merge commit resolutions I ommited commiting by accident. 2023-06-20 18:32:50 +02:00
Martin Sosic
8b6fdc7b6e Merge branch 'main' into wasp-ai 2023-06-20 18:30:20 +02:00