@jpetit/toolkit 3.0.23 → 3.1.2

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.
Files changed (61) hide show
  1. package/assets/prompts/creators/create-solution.tpl.txt +10 -0
  2. package/assets/prompts/creators/create-statement.tpl.txt +21 -0
  3. package/assets/prompts/creators/create-translation.tpl.txt +5 -0
  4. package/assets/prompts/creators/private-test-cases.txt +6 -0
  5. package/assets/prompts/creators/sample-test-cases.txt +6 -0
  6. package/assets/prompts/creators/system-prompt.txt +2 -0
  7. package/assets/prompts/examples/statement-coda.tex +7 -0
  8. package/assets/prompts/examples/statement.tex +19 -0
  9. package/assets/prompts/generators/efficiency.md +41 -0
  10. package/assets/prompts/generators/hard.md +47 -0
  11. package/assets/prompts/generators/random.md +39 -0
  12. package/assets/prompts/proglangs/cc.md +3 -0
  13. package/assets/prompts/proglangs/py.md +40 -0
  14. package/lib/ai.ts +60 -4
  15. package/lib/cleaner.ts +24 -13
  16. package/lib/compilers/base.ts +70 -14
  17. package/lib/compilers/clojure.ts +21 -10
  18. package/lib/compilers/gcc.ts +4 -33
  19. package/lib/compilers/ghc.ts +4 -40
  20. package/lib/compilers/gxx.ts +4 -33
  21. package/lib/compilers/index.ts +9 -0
  22. package/lib/compilers/java.ts +105 -0
  23. package/lib/compilers/python3.ts +44 -37
  24. package/lib/compilers/run-clojure.ts +101 -0
  25. package/lib/compilers/run-haskell.ts +26 -22
  26. package/lib/compilers/run-python.ts +29 -35
  27. package/lib/compilers/rust.ts +39 -0
  28. package/lib/create-with-jutgeai.ts +407 -0
  29. package/lib/create-with-template.ts +55 -0
  30. package/lib/data.ts +6 -0
  31. package/lib/doctor.ts +86 -6
  32. package/lib/generate.ts +132 -290
  33. package/lib/helpers.ts +48 -0
  34. package/lib/inspector.ts +253 -0
  35. package/lib/jutge_api_client.ts +4631 -0
  36. package/lib/maker.ts +202 -289
  37. package/lib/settings.ts +26 -17
  38. package/lib/tui.ts +25 -15
  39. package/lib/types.ts +40 -5
  40. package/lib/upload.ts +216 -0
  41. package/lib/utils.ts +82 -14
  42. package/lib/versions.ts +46 -0
  43. package/package.json +50 -11
  44. package/toolkit/about.ts +43 -0
  45. package/toolkit/ai.ts +44 -18
  46. package/toolkit/check.ts +16 -0
  47. package/toolkit/clean.ts +16 -26
  48. package/toolkit/compilers.ts +4 -4
  49. package/toolkit/config.ts +91 -0
  50. package/toolkit/create.ts +30 -58
  51. package/toolkit/doctor.ts +15 -11
  52. package/toolkit/generate.ts +195 -98
  53. package/toolkit/index.ts +32 -21
  54. package/toolkit/make.ts +12 -48
  55. package/toolkit/upgrade.ts +9 -0
  56. package/toolkit/upload.ts +19 -0
  57. package/toolkit/create-jutge-ai.ts +0 -101
  58. package/toolkit/create-template.ts +0 -55
  59. package/toolkit/create-wizard.ts +0 -6
  60. package/toolkit/init.ts +0 -56
  61. package/toolkit/verify.ts +0 -19
@@ -1,6 +0,0 @@
1
- import { nothing } from '../lib/utils'
2
-
3
- export async function createProblemWithWizard(outputDir: string): Promise<void> {
4
- await nothing()
5
- throw new Error('Wizard method is not yet implemented.')
6
- }
package/toolkit/init.ts DELETED
@@ -1,56 +0,0 @@
1
- import { initializePaths, loadSettings, paths, saveSettings, settingsExist } from '../lib/settings'
2
- import tui from '../lib/tui'
3
- import { guessUserEmail, guessUserName, nothing } from '../lib/utils'
4
- import { Command } from '@commander-js/extra-typings'
5
- import { confirm, input } from '@inquirer/prompts'
6
- import chalk from 'chalk'
7
-
8
- async function initialize() {
9
- await tui.section('Initialize', async () => {
10
- let name = (await guessUserName()) || 'John Doe'
11
- let email = (await guessUserEmail()) || 'john.doe@example.com'
12
-
13
- name = await input({ message: 'What is your name?', default: name })
14
- email = await input({ message: 'What is your email?', default: email })
15
- const notifications = await confirm({ message: 'Enable notifications?', default: true })
16
-
17
- await initializePaths()
18
- await saveSettings({ name, email, notifications })
19
-
20
- tui.success('Settings created')
21
- })
22
- }
23
-
24
- async function configure() {
25
- await tui.section('Configure', async () => {
26
- const settings = await loadSettings()
27
-
28
- const name = await input({ message: 'What is your name?', default: settings.name })
29
- const email = await input({ message: 'What is your email?', default: settings.email })
30
- const notifications = await confirm({ message: 'Enable notifications?', default: settings.notifications })
31
-
32
- await saveSettings({ name, email, notifications })
33
-
34
- tui.success('Settings updated')
35
- })
36
- }
37
-
38
- export const init = new Command('init')
39
- .description('Initialize/configure the toolkit')
40
-
41
- .action(async () => {
42
- if (await settingsExist()) {
43
- await configure()
44
- } else {
45
- await initialize()
46
- }
47
-
48
- await tui.section('Directories', async () => {
49
- await nothing()
50
- console.log('config:', chalk.magenta(paths.config))
51
- console.log('data: ', chalk.magenta(paths.data))
52
- console.log('cache: ', chalk.magenta(paths.cache))
53
- console.log('log: ', chalk.magenta(paths.log))
54
- console.log('temp: ', chalk.magenta(paths.temp))
55
- })
56
- })
package/toolkit/verify.ts DELETED
@@ -1,19 +0,0 @@
1
- import { newMaker } from '../lib/maker'
2
- import { Command } from '@commander-js/extra-typings'
3
- import { normalize } from 'path'
4
-
5
- export const verify = new Command('verify')
6
- .description('Verify candidate programs')
7
- // Add common options here
8
-
9
- .argument('<programs...>', 'source programs to verify')
10
- .option('-d, --directory <path>', 'problem directory', process.cwd()) // TODO: use '.' when bun fixes it
11
- .option('-v, --verbose', 'verbose output (TODO)')
12
-
13
- .action(async (programs, { directory, verbose }) => {
14
- directory = normalize(directory)
15
- const maker = await newMaker({ verbose, directory })
16
- for (const program of programs) {
17
- await maker.verifyCandidate(program)
18
- }
19
- })