practicode 0.1.0 → 0.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/Cargo.lock +1 -1
- package/Cargo.toml +1 -1
- package/README.md +43 -101
- package/THIRD_PARTY_LICENSES.md +58 -0
- package/assets/i18n/en.json +50 -0
- package/assets/i18n/es.json +50 -0
- package/assets/i18n/ja.json +50 -0
- package/assets/i18n/ko.json +50 -0
- package/assets/i18n/zh.json +50 -0
- package/docs/CONTRIBUTING.md +81 -0
- package/package.json +4 -2
- package/scripts/release.sh +69 -0
- package/src/ai.rs +38 -6
- package/src/core.rs +116 -32
- package/src/i18n.rs +45 -0
- package/src/lib.rs +2 -0
- package/src/tui.rs +470 -91
- package/src/update.rs +45 -0
package/Cargo.lock
CHANGED
package/Cargo.toml
CHANGED
package/README.md
CHANGED
|
@@ -11,70 +11,55 @@
|
|
|
11
11
|
Personal coding practice, right in your terminal.
|
|
12
12
|
|
|
13
13
|
`practicode` is a small Rust TUI for stdin/stdout practice: problem on the left, code on the right, judge loop in the same terminal.
|
|
14
|
-
No browser tab shuffle, no paste dance, just solve and run.
|
|
15
14
|
|
|
16
|
-
##
|
|
15
|
+
## Start
|
|
17
16
|
|
|
18
|
-
|
|
19
|
-
- Gradual problem flow with local history
|
|
20
|
-
- AI-powered `/next <request>` when you want a custom problem
|
|
21
|
-
- Personal problem-generation notes
|
|
22
|
-
- Small stack: Rust, Ratatui, Crossterm, and plain process execution
|
|
17
|
+
### Prerequisites
|
|
23
18
|
|
|
24
|
-
|
|
19
|
+
- Node.js 18+ for npm installation.
|
|
20
|
+
- Rust and Cargo. The npm package builds the Rust binary during install, and also on first run if needed.
|
|
21
|
+
- A runtime for the language you practice in: Python, Node.js for TypeScript, JDK for Java, or Rust.
|
|
25
22
|
|
|
26
|
-
|
|
27
|
-
git clone https://github.com/baba9811/practicode.git
|
|
28
|
-
cd practicode
|
|
29
|
-
cargo run --
|
|
30
|
-
```
|
|
31
|
-
|
|
32
|
-
Want a local binary?
|
|
33
|
-
|
|
34
|
-
```bash
|
|
35
|
-
cargo install practicode
|
|
36
|
-
practicode
|
|
37
|
-
```
|
|
38
|
-
|
|
39
|
-
Prefer npm from GitHub?
|
|
23
|
+
### npm
|
|
40
24
|
|
|
41
25
|
```bash
|
|
42
|
-
npm install -g
|
|
26
|
+
npm install -g practicode
|
|
43
27
|
practicode
|
|
44
28
|
```
|
|
45
29
|
|
|
46
|
-
|
|
30
|
+
### Cargo
|
|
47
31
|
|
|
48
32
|
```bash
|
|
49
|
-
cargo install
|
|
33
|
+
cargo install practicode
|
|
50
34
|
practicode
|
|
51
35
|
```
|
|
52
36
|
|
|
53
|
-
|
|
37
|
+
### Local checkout
|
|
54
38
|
|
|
55
39
|
```bash
|
|
56
|
-
|
|
57
|
-
practicode
|
|
40
|
+
git clone https://github.com/baba9811/practicode.git
|
|
41
|
+
cd practicode
|
|
42
|
+
npm install
|
|
43
|
+
npm start
|
|
58
44
|
```
|
|
59
45
|
|
|
60
|
-
The npm wrapper builds the Rust binary with Cargo, so Rust/Cargo is still required.
|
|
61
|
-
|
|
62
46
|
## Daily Loop
|
|
63
47
|
|
|
64
48
|
The code editor starts focused.
|
|
65
49
|
|
|
66
50
|
```text
|
|
67
51
|
write code
|
|
68
|
-
Esc, then /
|
|
69
|
-
|
|
52
|
+
Esc, then /
|
|
53
|
+
choose /run
|
|
54
|
+
choose /next when it passes
|
|
70
55
|
```
|
|
71
56
|
|
|
57
|
+
Typing `/` outside the editor opens the command palette. Use `up/down` to move, `Enter` to run or complete the selected command, and `Esc` to cancel.
|
|
58
|
+
|
|
72
59
|
Submissions are saved as you type under `submissions/<problem-id>/solution.<ext>`.
|
|
73
60
|
|
|
74
61
|
## Commands
|
|
75
62
|
|
|
76
|
-
Press `Esc`, then `/`, to focus the command bar.
|
|
77
|
-
|
|
78
63
|
| Command | Action |
|
|
79
64
|
| --- | --- |
|
|
80
65
|
| `/run` | Judge the current submission |
|
|
@@ -85,22 +70,22 @@ Press `Esc`, then `/`, to focus the command bar.
|
|
|
85
70
|
| `/open 2` | Open by number, id, or slug |
|
|
86
71
|
| `/giveup` | Show the reference answer |
|
|
87
72
|
| `/ai hint` | Ask the selected AI about the current problem and submission |
|
|
88
|
-
| `/provider codex` | Set AI provider
|
|
89
|
-
| `/model
|
|
73
|
+
| `/provider codex` | Set AI provider and show local CLI/daemon status |
|
|
74
|
+
| `/model auto` | Set the model for `/ai` and AI-backed `/next` |
|
|
90
75
|
| `/note prefer hashmap practice` | Append a standing note for future problem generation |
|
|
91
76
|
| `/notes` | Show your local next-problem notes |
|
|
92
|
-
| `/lang python` | Set language: `python`, `ts`, `java`, `rust` |
|
|
93
|
-
| `/ui
|
|
94
|
-
| `/theme` |
|
|
77
|
+
| `/lang python` | Set code language: `python`, `ts`, `java`, `rust` |
|
|
78
|
+
| `/ui en` | Set UI language: `en`, `ko`, `ja`, `zh`, `es` |
|
|
79
|
+
| `/theme dark` | Set theme: `dark` or `light` |
|
|
95
80
|
| `/source ai` | Prefer AI for next-problem generation |
|
|
81
|
+
| `/update` | Show update instructions when a newer version is available |
|
|
96
82
|
| `/exit` | Quit |
|
|
97
83
|
|
|
98
|
-
The
|
|
99
|
-
Press `Esc`, then `/`, when you want the command bar.
|
|
84
|
+
The default UI language is English. Switch it any time with `/ui ko`, `/ui ja`, `/ui zh`, or `/ui es`.
|
|
100
85
|
|
|
101
|
-
##
|
|
86
|
+
## AI Problems
|
|
102
87
|
|
|
103
|
-
`/next <request>` passes your request into the selected AI problem generator.
|
|
88
|
+
`/next <request>` passes your request into the selected AI problem generator.
|
|
104
89
|
|
|
105
90
|
```text
|
|
106
91
|
/next a slightly harder string problem
|
|
@@ -108,19 +93,7 @@ Press `Esc`, then `/`, when you want the command bar.
|
|
|
108
93
|
/next sorting problem, no graph yet
|
|
109
94
|
```
|
|
110
95
|
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
```text
|
|
114
|
-
/note Prefer concise statements.
|
|
115
|
-
/note I want more string and hashmap practice.
|
|
116
|
-
/note Avoid DP until I ask for it.
|
|
117
|
-
```
|
|
118
|
-
|
|
119
|
-
Those notes are stored in `.practicode/problem_notes.md`, so they stay local.
|
|
120
|
-
|
|
121
|
-
## AI Providers
|
|
122
|
-
|
|
123
|
-
Codex is the default:
|
|
96
|
+
Codex is the default provider:
|
|
124
97
|
|
|
125
98
|
```text
|
|
126
99
|
/provider codex
|
|
@@ -135,14 +108,11 @@ Claude Code is also supported:
|
|
|
135
108
|
/source ai
|
|
136
109
|
```
|
|
137
110
|
|
|
138
|
-
|
|
139
|
-
If you want a custom daemon or wrapper script, set `/ai-next-command <shell command>`; practicode passes `PRACTICODE_NEXT_REQUEST`, `PRACTICODE_AI_PROVIDER`, and `PRACTICODE_AI_MODEL`.
|
|
140
|
-
|
|
141
|
-
Generated problem banks stay local:
|
|
111
|
+
Generated problems and submissions stay local:
|
|
142
112
|
|
|
143
113
|
| Path | Purpose |
|
|
144
114
|
| --- | --- |
|
|
145
|
-
| `.practicode/problem_bank.json` | Local/custom/generated
|
|
115
|
+
| `.practicode/problem_bank.json` | Local/custom/generated problems |
|
|
146
116
|
| `.practicode/problem_notes.md` | Optional personal problem-generation notes |
|
|
147
117
|
| `.practicode/problem-state.json` | Current problem, history, settings |
|
|
148
118
|
| `problems/` | Generated problem markdown/index files |
|
|
@@ -150,51 +120,23 @@ Generated problem banks stay local:
|
|
|
150
120
|
|
|
151
121
|
Those paths are ignored by git, so your practice history stays yours.
|
|
152
122
|
|
|
153
|
-
##
|
|
154
|
-
|
|
155
|
-
`/run` executes your local submission as a normal process. practicode runs it from `.practicode/build/<problem-id>/run`, but this is not an OS sandbox. Only run code you trust.
|
|
123
|
+
## Update
|
|
156
124
|
|
|
157
|
-
|
|
125
|
+
The app checks for newer npm releases in the background and shows `/update` in the status line when one is available. Disable that check with `PRACTICODE_NO_UPDATE_CHECK=1`.
|
|
158
126
|
|
|
159
|
-
|
|
127
|
+
```bash
|
|
128
|
+
npm update -g practicode
|
|
129
|
+
cargo install --force practicode
|
|
130
|
+
```
|
|
160
131
|
|
|
161
|
-
|
|
162
|
-
import sys
|
|
132
|
+
## Safety
|
|
163
133
|
|
|
164
|
-
|
|
165
|
-
```
|
|
134
|
+
`/run` executes your local submission as a normal process. practicode runs it from `.practicode/build/<problem-id>/run`, but this is not an OS sandbox. Only run code you trust.
|
|
166
135
|
|
|
167
|
-
##
|
|
136
|
+
## Contributors
|
|
168
137
|
|
|
169
|
-
|
|
170
|
-
cargo test
|
|
171
|
-
cargo run -- --smoke
|
|
172
|
-
cargo run --
|
|
173
|
-
```
|
|
138
|
+
Development, release, problem-authoring, and design references live in [docs/CONTRIBUTING.md](docs/CONTRIBUTING.md).
|
|
174
139
|
|
|
175
|
-
|
|
140
|
+
## License
|
|
176
141
|
|
|
177
|
-
|
|
178
|
-
| --- | --- |
|
|
179
|
-
| `src/core.rs` | Problem bank, state, rendering, judging |
|
|
180
|
-
| `src/tui.rs` | Ratatui app, editor, command parser |
|
|
181
|
-
| `src/ai.rs` | Codex/Claude command integration and notes |
|
|
182
|
-
| `src/text.rs` | UTF-8 cursor math and Hangul composition |
|
|
183
|
-
| `src/process.rs` | Process execution helpers |
|
|
184
|
-
| `tests/` | Integration tests split by module |
|
|
185
|
-
|
|
186
|
-
## Discovery Notes
|
|
187
|
-
|
|
188
|
-
Recommended GitHub topics for this repo:
|
|
189
|
-
`coding-practice`, `competitive-programming`, `algorithms`, `ratatui`, `tui`, `rust`, `codex`, `claude-code`, `local-first`.
|
|
190
|
-
|
|
191
|
-
## References
|
|
192
|
-
|
|
193
|
-
- Ratatui terminal UI library: https://ratatui.rs/
|
|
194
|
-
- Crossterm terminal backend/events: https://github.com/crossterm-rs/crossterm
|
|
195
|
-
- Codex CLI open-source repo: https://github.com/openai/codex
|
|
196
|
-
- Claude Code CLI reference: https://docs.anthropic.com/en/docs/claude-code/cli-reference
|
|
197
|
-
- Kattis problem package format: https://www.kattis.com/problem-package-format/
|
|
198
|
-
- ICPC judging guidelines: https://icpc.global/regionals/regional-contest-cookbook-judging-guidelines
|
|
199
|
-
- GitHub README image guidance: https://docs.github.com/repositories/managing-your-repositorys-settings-and-features/customizing-your-repository/about-readmes
|
|
200
|
-
- GitHub repository topics: https://docs.github.com/articles/classifying-your-repository-with-topics
|
|
142
|
+
practicode is MIT licensed. Third-party dependency license notes are in [THIRD_PARTY_LICENSES.md](THIRD_PARTY_LICENSES.md).
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
# Third-Party Licenses
|
|
2
|
+
|
|
3
|
+
This file summarizes third-party dependency license metadata for practicode
|
|
4
|
+
0.1.0, checked from Cargo.lock and Cargo metadata.
|
|
5
|
+
|
|
6
|
+
This is not legal advice.
|
|
7
|
+
|
|
8
|
+
## Project License
|
|
9
|
+
|
|
10
|
+
practicode is licensed under MIT. The current dependency set is compatible with
|
|
11
|
+
that choice: all Rust dependencies use permissive licenses, and the npm package
|
|
12
|
+
has no npm dependencies.
|
|
13
|
+
|
|
14
|
+
## npm Dependencies
|
|
15
|
+
|
|
16
|
+
None.
|
|
17
|
+
|
|
18
|
+
## Direct Rust Dependencies
|
|
19
|
+
|
|
20
|
+
| Crate | Version | License |
|
|
21
|
+
| --- | --- | --- |
|
|
22
|
+
| anyhow | 1.0.103 | MIT OR Apache-2.0 |
|
|
23
|
+
| crossterm | 0.29.0 | MIT |
|
|
24
|
+
| ratatui | 0.29.0 | MIT |
|
|
25
|
+
| serde | 1.0.228 | MIT OR Apache-2.0 |
|
|
26
|
+
| serde_json | 1.0.150 | MIT OR Apache-2.0 |
|
|
27
|
+
| unicode-width | 0.2.0 | MIT OR Apache-2.0 |
|
|
28
|
+
| wait-timeout | 0.2.1 | MIT/Apache-2.0 |
|
|
29
|
+
|
|
30
|
+
## Transitive Rust Dependency License Groups
|
|
31
|
+
|
|
32
|
+
The locked Rust dependency graph contains 87 third-party packages.
|
|
33
|
+
|
|
34
|
+
| License expression | Packages |
|
|
35
|
+
| --- | ---: |
|
|
36
|
+
| MIT OR Apache-2.0 | 50 |
|
|
37
|
+
| MIT | 20 |
|
|
38
|
+
| MIT/Apache-2.0 | 5 |
|
|
39
|
+
| Apache-2.0 WITH LLVM-exception OR Apache-2.0 OR MIT | 5 |
|
|
40
|
+
| Apache-2.0 OR MIT | 1 |
|
|
41
|
+
| Apache-2.0/MIT | 1 |
|
|
42
|
+
| MIT / Apache-2.0 | 1 |
|
|
43
|
+
| Unlicense OR MIT | 1 |
|
|
44
|
+
| Zlib | 1 |
|
|
45
|
+
| Apache-2.0 OR BSL-1.0 | 1 |
|
|
46
|
+
| (MIT OR Apache-2.0) AND Unicode-3.0 | 1 |
|
|
47
|
+
|
|
48
|
+
No GPL, LGPL, AGPL, or MPL dependencies were detected in the locked Rust
|
|
49
|
+
dependency graph.
|
|
50
|
+
|
|
51
|
+
## Release Notes
|
|
52
|
+
|
|
53
|
+
The crates.io and npm packages distribute practicode source, not vendored
|
|
54
|
+
third-party source or prebuilt third-party binaries. The npm installer builds
|
|
55
|
+
the Rust binary locally with Cargo.
|
|
56
|
+
|
|
57
|
+
If practicode later ships prebuilt binaries, include full third-party notices
|
|
58
|
+
and license texts with those binary artifacts.
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
{
|
|
2
|
+
"problem": "Problem",
|
|
3
|
+
"output": "Output",
|
|
4
|
+
"command": "Command",
|
|
5
|
+
"commands": "Commands",
|
|
6
|
+
"difficulty": "Difficulty",
|
|
7
|
+
"topics": "Topics",
|
|
8
|
+
"input": "Input",
|
|
9
|
+
"examples": "Examples",
|
|
10
|
+
"example": "Example",
|
|
11
|
+
"answer": "Answer",
|
|
12
|
+
"source": "source",
|
|
13
|
+
"update": "update",
|
|
14
|
+
"command_placeholder": "Type /, move with up/down, Enter runs",
|
|
15
|
+
"palette_hint": "up/down select | Enter run | Esc cancel",
|
|
16
|
+
"hint_command": "Enter submit | Esc cancel",
|
|
17
|
+
"hint_list": "up/down move | Enter open | Esc close",
|
|
18
|
+
"hint_output": "Esc code | / command | ? help",
|
|
19
|
+
"hint_code": "Esc then / command",
|
|
20
|
+
"hint_idle": "/ command | ? help",
|
|
21
|
+
"help_title": "Help",
|
|
22
|
+
"daily_loop": "Daily loop",
|
|
23
|
+
"keys": "Keys",
|
|
24
|
+
"debug_prints": "Debug prints",
|
|
25
|
+
"cmd_run": "Judge the current submission",
|
|
26
|
+
"cmd_edit": "Return to the code editor",
|
|
27
|
+
"cmd_next": "Open the next problem",
|
|
28
|
+
"cmd_prev": "Open the previous problem",
|
|
29
|
+
"cmd_list": "Browse problems",
|
|
30
|
+
"cmd_open": "Open by number, id, or slug",
|
|
31
|
+
"cmd_giveup": "Show the reference answer",
|
|
32
|
+
"cmd_ai": "Ask AI about the current problem and code",
|
|
33
|
+
"cmd_provider": "Set AI provider",
|
|
34
|
+
"cmd_model": "Set AI model",
|
|
35
|
+
"cmd_note": "Add a next-problem note",
|
|
36
|
+
"cmd_notes": "Show saved notes",
|
|
37
|
+
"cmd_lang": "Set code language",
|
|
38
|
+
"cmd_ui": "Set UI language",
|
|
39
|
+
"cmd_theme": "Set theme",
|
|
40
|
+
"cmd_source": "Set next-problem source",
|
|
41
|
+
"cmd_update": "Show update instructions",
|
|
42
|
+
"cmd_help": "Open help",
|
|
43
|
+
"cmd_exit": "Quit",
|
|
44
|
+
"update_available": "Update available",
|
|
45
|
+
"update_none": "practicode is up to date.",
|
|
46
|
+
"update_check_disabled": "Update check is disabled.",
|
|
47
|
+
"update_check_failed": "Could not check for updates.",
|
|
48
|
+
"generating_next": "Generating next problem",
|
|
49
|
+
"already_busy": "Already busy."
|
|
50
|
+
}
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
{
|
|
2
|
+
"problem": "Problema",
|
|
3
|
+
"output": "Salida",
|
|
4
|
+
"command": "Comando",
|
|
5
|
+
"commands": "Comandos",
|
|
6
|
+
"difficulty": "Dificultad",
|
|
7
|
+
"topics": "Temas",
|
|
8
|
+
"input": "Entrada",
|
|
9
|
+
"examples": "Ejemplos",
|
|
10
|
+
"example": "Ejemplo",
|
|
11
|
+
"answer": "Respuesta",
|
|
12
|
+
"source": "fuente",
|
|
13
|
+
"update": "actualizacion",
|
|
14
|
+
"command_placeholder": "Escribe /, elige con arriba/abajo, Enter ejecuta",
|
|
15
|
+
"palette_hint": "arriba/abajo elegir | Enter ejecutar | Esc cancelar",
|
|
16
|
+
"hint_command": "Enter ejecutar | Esc cancelar",
|
|
17
|
+
"hint_list": "arriba/abajo mover | Enter abrir | Esc cerrar",
|
|
18
|
+
"hint_output": "Esc codigo | / comando | ? ayuda",
|
|
19
|
+
"hint_code": "Esc y luego / comando",
|
|
20
|
+
"hint_idle": "/ comando | ? ayuda",
|
|
21
|
+
"help_title": "Ayuda",
|
|
22
|
+
"daily_loop": "Flujo diario",
|
|
23
|
+
"keys": "Teclas",
|
|
24
|
+
"debug_prints": "Salida de depuracion",
|
|
25
|
+
"cmd_run": "Evalua la solucion actual",
|
|
26
|
+
"cmd_edit": "Volver al editor de codigo",
|
|
27
|
+
"cmd_next": "Abrir el siguiente problema",
|
|
28
|
+
"cmd_prev": "Abrir el problema anterior",
|
|
29
|
+
"cmd_list": "Abrir la lista de problemas",
|
|
30
|
+
"cmd_open": "Abrir por numero, id o slug",
|
|
31
|
+
"cmd_giveup": "Mostrar la respuesta de referencia",
|
|
32
|
+
"cmd_ai": "Preguntar a AI sobre el problema y codigo actuales",
|
|
33
|
+
"cmd_provider": "Configurar AI provider",
|
|
34
|
+
"cmd_model": "Configurar AI model",
|
|
35
|
+
"cmd_note": "Agregar nota para generar problemas",
|
|
36
|
+
"cmd_notes": "Ver notas guardadas",
|
|
37
|
+
"cmd_lang": "Configurar lenguaje de codigo",
|
|
38
|
+
"cmd_ui": "Configurar idioma de UI",
|
|
39
|
+
"cmd_theme": "Configurar tema",
|
|
40
|
+
"cmd_source": "Configurar fuente del siguiente problema",
|
|
41
|
+
"cmd_update": "Mostrar instrucciones de actualizacion",
|
|
42
|
+
"cmd_help": "Abrir ayuda",
|
|
43
|
+
"cmd_exit": "Salir",
|
|
44
|
+
"update_available": "Hay una nueva version",
|
|
45
|
+
"update_none": "practicode esta actualizado.",
|
|
46
|
+
"update_check_disabled": "La comprobacion de actualizaciones esta desactivada.",
|
|
47
|
+
"update_check_failed": "No se pudo comprobar actualizaciones.",
|
|
48
|
+
"generating_next": "Generando el siguiente problema",
|
|
49
|
+
"already_busy": "Ya hay una tarea en curso."
|
|
50
|
+
}
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
{
|
|
2
|
+
"problem": "問題",
|
|
3
|
+
"output": "出力",
|
|
4
|
+
"command": "コマンド",
|
|
5
|
+
"commands": "コマンド",
|
|
6
|
+
"difficulty": "難易度",
|
|
7
|
+
"topics": "トピック",
|
|
8
|
+
"input": "入力",
|
|
9
|
+
"examples": "例",
|
|
10
|
+
"example": "例",
|
|
11
|
+
"answer": "解答",
|
|
12
|
+
"source": "source",
|
|
13
|
+
"update": "update",
|
|
14
|
+
"command_placeholder": "/ を入力し上下で選択、Enter で実行",
|
|
15
|
+
"palette_hint": "上下 選択 | Enter 実行 | Esc キャンセル",
|
|
16
|
+
"hint_command": "Enter 実行 | Esc キャンセル",
|
|
17
|
+
"hint_list": "上下 移動 | Enter 開く | Esc 閉じる",
|
|
18
|
+
"hint_output": "Esc コード | / コマンド | ? ヘルプ",
|
|
19
|
+
"hint_code": "Esc の後 / コマンド",
|
|
20
|
+
"hint_idle": "/ コマンド | ? ヘルプ",
|
|
21
|
+
"help_title": "ヘルプ",
|
|
22
|
+
"daily_loop": "基本フロー",
|
|
23
|
+
"keys": "キー",
|
|
24
|
+
"debug_prints": "デバッグ出力",
|
|
25
|
+
"cmd_run": "現在の提出を判定",
|
|
26
|
+
"cmd_edit": "コードエディタに戻る",
|
|
27
|
+
"cmd_next": "次の問題を開く",
|
|
28
|
+
"cmd_prev": "前の問題を開く",
|
|
29
|
+
"cmd_list": "問題一覧を開く",
|
|
30
|
+
"cmd_open": "番号、id、slug で問題を開く",
|
|
31
|
+
"cmd_giveup": "解答を見る",
|
|
32
|
+
"cmd_ai": "現在の問題とコードについて AI に質問",
|
|
33
|
+
"cmd_provider": "AI provider を設定",
|
|
34
|
+
"cmd_model": "AI model を設定",
|
|
35
|
+
"cmd_note": "次の問題生成メモを追加",
|
|
36
|
+
"cmd_notes": "保存済みメモを見る",
|
|
37
|
+
"cmd_lang": "コード言語を設定",
|
|
38
|
+
"cmd_ui": "UI 言語を設定",
|
|
39
|
+
"cmd_theme": "テーマを設定",
|
|
40
|
+
"cmd_source": "次の問題の取得元を設定",
|
|
41
|
+
"cmd_update": "更新手順を表示",
|
|
42
|
+
"cmd_help": "ヘルプを開く",
|
|
43
|
+
"cmd_exit": "終了",
|
|
44
|
+
"update_available": "新しいバージョンがあります",
|
|
45
|
+
"update_none": "practicode は最新です。",
|
|
46
|
+
"update_check_disabled": "更新確認は無効です。",
|
|
47
|
+
"update_check_failed": "更新を確認できませんでした。",
|
|
48
|
+
"generating_next": "次の問題を生成中",
|
|
49
|
+
"already_busy": "すでに処理中です。"
|
|
50
|
+
}
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
{
|
|
2
|
+
"problem": "문제",
|
|
3
|
+
"output": "출력",
|
|
4
|
+
"command": "명령",
|
|
5
|
+
"commands": "명령",
|
|
6
|
+
"difficulty": "난이도",
|
|
7
|
+
"topics": "주제",
|
|
8
|
+
"input": "입력",
|
|
9
|
+
"examples": "예시",
|
|
10
|
+
"example": "예시",
|
|
11
|
+
"answer": "정답",
|
|
12
|
+
"source": "출처",
|
|
13
|
+
"update": "업데이트",
|
|
14
|
+
"command_placeholder": "/ 입력 후 위/아래로 선택, Enter 실행",
|
|
15
|
+
"palette_hint": "위/아래 선택 | Enter 실행 | Esc 취소",
|
|
16
|
+
"hint_command": "Enter 실행 | Esc 취소",
|
|
17
|
+
"hint_list": "위/아래 이동 | Enter 열기 | Esc 닫기",
|
|
18
|
+
"hint_output": "Esc 코드 | / 명령 | ? 도움말",
|
|
19
|
+
"hint_code": "Esc 후 / 명령",
|
|
20
|
+
"hint_idle": "/ 명령 | ? 도움말",
|
|
21
|
+
"help_title": "도움말",
|
|
22
|
+
"daily_loop": "기본 흐름",
|
|
23
|
+
"keys": "키",
|
|
24
|
+
"debug_prints": "디버그 출력",
|
|
25
|
+
"cmd_run": "현재 제출을 채점",
|
|
26
|
+
"cmd_edit": "코드 편집기로 돌아가기",
|
|
27
|
+
"cmd_next": "다음 문제 열기",
|
|
28
|
+
"cmd_prev": "이전 문제 열기",
|
|
29
|
+
"cmd_list": "문제 목록 열기",
|
|
30
|
+
"cmd_open": "번호, id, slug로 문제 열기",
|
|
31
|
+
"cmd_giveup": "정답 보기",
|
|
32
|
+
"cmd_ai": "현재 문제와 코드에 대해 AI에게 질문",
|
|
33
|
+
"cmd_provider": "AI provider 설정",
|
|
34
|
+
"cmd_model": "AI model 설정",
|
|
35
|
+
"cmd_note": "다음 문제 생성 메모 추가",
|
|
36
|
+
"cmd_notes": "저장된 메모 보기",
|
|
37
|
+
"cmd_lang": "코드 언어 설정",
|
|
38
|
+
"cmd_ui": "UI 언어 설정",
|
|
39
|
+
"cmd_theme": "테마 설정",
|
|
40
|
+
"cmd_source": "다음 문제 출처 설정",
|
|
41
|
+
"cmd_update": "업데이트 안내 보기",
|
|
42
|
+
"cmd_help": "도움말 열기",
|
|
43
|
+
"cmd_exit": "종료",
|
|
44
|
+
"update_available": "새 버전 사용 가능",
|
|
45
|
+
"update_none": "practicode가 최신 버전입니다.",
|
|
46
|
+
"update_check_disabled": "업데이트 확인이 꺼져 있습니다.",
|
|
47
|
+
"update_check_failed": "업데이트를 확인할 수 없습니다.",
|
|
48
|
+
"generating_next": "다음 문제 생성 중",
|
|
49
|
+
"already_busy": "이미 작업 중입니다."
|
|
50
|
+
}
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
{
|
|
2
|
+
"problem": "题目",
|
|
3
|
+
"output": "输出",
|
|
4
|
+
"command": "命令",
|
|
5
|
+
"commands": "命令",
|
|
6
|
+
"difficulty": "难度",
|
|
7
|
+
"topics": "主题",
|
|
8
|
+
"input": "输入",
|
|
9
|
+
"examples": "示例",
|
|
10
|
+
"example": "示例",
|
|
11
|
+
"answer": "答案",
|
|
12
|
+
"source": "来源",
|
|
13
|
+
"update": "更新",
|
|
14
|
+
"command_placeholder": "输入 / 后用上下键选择,Enter 执行",
|
|
15
|
+
"palette_hint": "上下 选择 | Enter 执行 | Esc 取消",
|
|
16
|
+
"hint_command": "Enter 执行 | Esc 取消",
|
|
17
|
+
"hint_list": "上下 移动 | Enter 打开 | Esc 关闭",
|
|
18
|
+
"hint_output": "Esc 代码 | / 命令 | ? 帮助",
|
|
19
|
+
"hint_code": "Esc 后输入 / 命令",
|
|
20
|
+
"hint_idle": "/ 命令 | ? 帮助",
|
|
21
|
+
"help_title": "帮助",
|
|
22
|
+
"daily_loop": "日常流程",
|
|
23
|
+
"keys": "按键",
|
|
24
|
+
"debug_prints": "调试输出",
|
|
25
|
+
"cmd_run": "评测当前提交",
|
|
26
|
+
"cmd_edit": "回到代码编辑器",
|
|
27
|
+
"cmd_next": "打开下一题",
|
|
28
|
+
"cmd_prev": "打开上一题",
|
|
29
|
+
"cmd_list": "打开题目列表",
|
|
30
|
+
"cmd_open": "按编号、id 或 slug 打开题目",
|
|
31
|
+
"cmd_giveup": "显示参考答案",
|
|
32
|
+
"cmd_ai": "向 AI 询问当前题目和代码",
|
|
33
|
+
"cmd_provider": "设置 AI provider",
|
|
34
|
+
"cmd_model": "设置 AI model",
|
|
35
|
+
"cmd_note": "添加下次出题备注",
|
|
36
|
+
"cmd_notes": "查看保存的备注",
|
|
37
|
+
"cmd_lang": "设置代码语言",
|
|
38
|
+
"cmd_ui": "设置 UI 语言",
|
|
39
|
+
"cmd_theme": "设置主题",
|
|
40
|
+
"cmd_source": "设置下一题来源",
|
|
41
|
+
"cmd_update": "显示更新说明",
|
|
42
|
+
"cmd_help": "打开帮助",
|
|
43
|
+
"cmd_exit": "退出",
|
|
44
|
+
"update_available": "有新版本可用",
|
|
45
|
+
"update_none": "practicode 已是最新版本。",
|
|
46
|
+
"update_check_disabled": "更新检查已禁用。",
|
|
47
|
+
"update_check_failed": "无法检查更新。",
|
|
48
|
+
"generating_next": "正在生成下一题",
|
|
49
|
+
"already_busy": "已有任务正在运行。"
|
|
50
|
+
}
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
# Contributing
|
|
2
|
+
|
|
3
|
+
This repo is a Rust coding-practice workspace with a Ratatui terminal UI.
|
|
4
|
+
|
|
5
|
+
## Prerequisites
|
|
6
|
+
|
|
7
|
+
- Rust stable with Cargo, rustfmt, and clippy.
|
|
8
|
+
- Node.js 18+ for the npm wrapper and package checks.
|
|
9
|
+
- Optional local runtimes for judging: Python, Node.js, JDK, and Rust.
|
|
10
|
+
|
|
11
|
+
## Development
|
|
12
|
+
|
|
13
|
+
```bash
|
|
14
|
+
cargo run --
|
|
15
|
+
cargo run -- --smoke
|
|
16
|
+
cargo test
|
|
17
|
+
npm run smoke
|
|
18
|
+
```
|
|
19
|
+
|
|
20
|
+
Full local check:
|
|
21
|
+
|
|
22
|
+
```bash
|
|
23
|
+
make test
|
|
24
|
+
```
|
|
25
|
+
|
|
26
|
+
The source is split by boring responsibility:
|
|
27
|
+
|
|
28
|
+
| Path | Role |
|
|
29
|
+
| --- | --- |
|
|
30
|
+
| `src/core.rs` | Problem storage, state, rendering, judging |
|
|
31
|
+
| `src/i18n.rs` | Loads UI strings from `assets/i18n/*.json` |
|
|
32
|
+
| `src/tui.rs` | Ratatui app, editor, command parser |
|
|
33
|
+
| `src/ai.rs` | Codex/Claude command integration and notes |
|
|
34
|
+
| `src/text.rs` | UTF-8 cursor math and Hangul composition |
|
|
35
|
+
| `src/process.rs` | Process execution helpers |
|
|
36
|
+
| `tests/` | Integration tests split by module |
|
|
37
|
+
|
|
38
|
+
## Problem Authoring
|
|
39
|
+
|
|
40
|
+
AI generation reads [problem-authoring-notes.md](problem-authoring-notes.md) every time it creates a problem.
|
|
41
|
+
|
|
42
|
+
Local generated data stays ignored by git:
|
|
43
|
+
|
|
44
|
+
| Path | Purpose |
|
|
45
|
+
| --- | --- |
|
|
46
|
+
| `.practicode/problem_bank.json` | Local/custom/generated problems |
|
|
47
|
+
| `.practicode/problem_notes.md` | Personal problem-generation notes |
|
|
48
|
+
| `.practicode/problem-state.json` | Current problem, history, settings |
|
|
49
|
+
| `problems/` | Generated problem markdown/index files |
|
|
50
|
+
| `submissions/` | Local answer files |
|
|
51
|
+
|
|
52
|
+
## Release
|
|
53
|
+
|
|
54
|
+
`main` runs CI only. Releases are tag-based and publish to crates.io and npm through GitHub Actions.
|
|
55
|
+
|
|
56
|
+
```bash
|
|
57
|
+
make release VERSION=0.1.1
|
|
58
|
+
```
|
|
59
|
+
|
|
60
|
+
The release script checks versions, runs tests, creates the version commit and tag, and pushes `main` plus the tag. Do not print or commit tokens; GitHub Actions uses repository secrets.
|
|
61
|
+
|
|
62
|
+
## Documentation
|
|
63
|
+
|
|
64
|
+
Keep the root [README](../README.md) focused on users. Put contributor workflow, implementation notes, release notes, and design references here or in nearby `docs/` files.
|
|
65
|
+
|
|
66
|
+
Use relative links for repo-local docs and assets. The terminal screenshot is stored at [assets/practicode-terminal.svg](../assets/practicode-terminal.svg).
|
|
67
|
+
|
|
68
|
+
## Localization
|
|
69
|
+
|
|
70
|
+
UI strings live in [assets/i18n](../assets/i18n). Keep English complete first; other locales can be partial because the runtime falls back per key to English.
|
|
71
|
+
|
|
72
|
+
## UX And Documentation References
|
|
73
|
+
|
|
74
|
+
- WAI-ARIA combobox keyboard interaction: https://www.w3.org/WAI/ARIA/apg/patterns/combobox/
|
|
75
|
+
- Command Line Interface Guidelines: https://clig.dev/
|
|
76
|
+
- GitHub README guidance: https://docs.github.com/en/repositories/managing-your-repositorys-settings-and-features/customizing-your-repository/about-readmes
|
|
77
|
+
- GitHub relative links and images: https://docs.github.com/en/get-started/writing-on-github/getting-started-with-writing-and-formatting-on-github/basic-writing-and-formatting-syntax#relative-links
|
|
78
|
+
- Ratatui terminal UI library: https://ratatui.rs/
|
|
79
|
+
- Crossterm terminal backend/events: https://github.com/crossterm-rs/crossterm
|
|
80
|
+
- Kattis problem package format: https://www.kattis.com/problem-package-format/
|
|
81
|
+
- ICPC judging guidelines: https://icpc.global/regionals/regional-contest-cookbook-judging-guidelines
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "practicode",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.2",
|
|
4
4
|
"description": "Local-first coding-test practice in a Rust terminal UI with optional AI help.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"repository": {
|
|
@@ -12,6 +12,7 @@
|
|
|
12
12
|
"practicode": "bin/practicode.js"
|
|
13
13
|
},
|
|
14
14
|
"scripts": {
|
|
15
|
+
"start": "node bin/practicode.js",
|
|
15
16
|
"build": "cargo build --release --locked",
|
|
16
17
|
"postinstall": "node scripts/npm-postinstall.js",
|
|
17
18
|
"smoke": "node bin/practicode.js --smoke"
|
|
@@ -25,7 +26,8 @@
|
|
|
25
26
|
"Cargo.lock",
|
|
26
27
|
"Cargo.toml",
|
|
27
28
|
"LICENSE",
|
|
28
|
-
"README.md"
|
|
29
|
+
"README.md",
|
|
30
|
+
"THIRD_PARTY_LICENSES.md"
|
|
29
31
|
],
|
|
30
32
|
"keywords": [
|
|
31
33
|
"algorithms",
|