@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.
- package/assets/prompts/creators/create-solution.tpl.txt +10 -0
- package/assets/prompts/creators/create-statement.tpl.txt +21 -0
- package/assets/prompts/creators/create-translation.tpl.txt +5 -0
- package/assets/prompts/creators/private-test-cases.txt +6 -0
- package/assets/prompts/creators/sample-test-cases.txt +6 -0
- package/assets/prompts/creators/system-prompt.txt +2 -0
- package/assets/prompts/examples/statement-coda.tex +7 -0
- package/assets/prompts/examples/statement.tex +19 -0
- package/assets/prompts/generators/efficiency.md +41 -0
- package/assets/prompts/generators/hard.md +47 -0
- package/assets/prompts/generators/random.md +39 -0
- package/assets/prompts/proglangs/cc.md +3 -0
- package/assets/prompts/proglangs/py.md +40 -0
- package/lib/ai.ts +60 -4
- package/lib/cleaner.ts +24 -13
- package/lib/compilers/base.ts +70 -14
- package/lib/compilers/clojure.ts +21 -10
- package/lib/compilers/gcc.ts +4 -33
- package/lib/compilers/ghc.ts +4 -40
- package/lib/compilers/gxx.ts +4 -33
- package/lib/compilers/index.ts +9 -0
- package/lib/compilers/java.ts +105 -0
- package/lib/compilers/python3.ts +44 -37
- package/lib/compilers/run-clojure.ts +101 -0
- package/lib/compilers/run-haskell.ts +26 -22
- package/lib/compilers/run-python.ts +29 -35
- package/lib/compilers/rust.ts +39 -0
- package/lib/create-with-jutgeai.ts +407 -0
- package/lib/create-with-template.ts +55 -0
- package/lib/data.ts +6 -0
- package/lib/doctor.ts +86 -6
- package/lib/generate.ts +132 -290
- package/lib/helpers.ts +48 -0
- package/lib/inspector.ts +253 -0
- package/lib/jutge_api_client.ts +4631 -0
- package/lib/maker.ts +202 -289
- package/lib/settings.ts +26 -17
- package/lib/tui.ts +25 -15
- package/lib/types.ts +40 -5
- package/lib/upload.ts +216 -0
- package/lib/utils.ts +82 -14
- package/lib/versions.ts +46 -0
- package/package.json +50 -11
- package/toolkit/about.ts +43 -0
- package/toolkit/ai.ts +44 -18
- package/toolkit/check.ts +16 -0
- package/toolkit/clean.ts +16 -26
- package/toolkit/compilers.ts +4 -4
- package/toolkit/config.ts +91 -0
- package/toolkit/create.ts +30 -58
- package/toolkit/doctor.ts +15 -11
- package/toolkit/generate.ts +195 -98
- package/toolkit/index.ts +32 -21
- package/toolkit/make.ts +12 -48
- package/toolkit/upgrade.ts +9 -0
- package/toolkit/upload.ts +19 -0
- package/toolkit/create-jutge-ai.ts +0 -101
- package/toolkit/create-template.ts +0 -55
- package/toolkit/create-wizard.ts +0 -6
- package/toolkit/init.ts +0 -56
- package/toolkit/verify.ts +0 -19
package/toolkit/create-wizard.ts
DELETED
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
|
-
})
|