prompsit-cli 26.311.2213 → 26.314.1453
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/LICENSE +191 -21
- package/README.md +140 -199
- package/assets/skills/README.md +33 -0
- package/assets/skills/prompsit-annotate/SKILL.md +55 -0
- package/assets/skills/prompsit-evaluate/SKILL.md +60 -0
- package/assets/skills/prompsit-score/SKILL.md +62 -0
- package/assets/skills/prompsit-setup/SKILL.md +146 -0
- package/assets/skills/prompsit-translate/SKILL.md +65 -0
- package/dist/api/auth-session.js +2 -2
- package/dist/api/auth-session.js.map +1 -1
- package/dist/api/errors.d.ts.map +1 -1
- package/dist/api/errors.js +13 -10
- package/dist/api/errors.js.map +1 -1
- package/dist/api/models.d.ts +19 -5
- package/dist/api/models.d.ts.map +1 -1
- package/dist/api/models.js +13 -5
- package/dist/api/models.js.map +1 -1
- package/dist/api/sse-models.d.ts +1 -1
- package/dist/api/sse-models.d.ts.map +1 -1
- package/dist/api/sse-models.js +4 -1
- package/dist/api/sse-models.js.map +1 -1
- package/dist/cli/prompts.d.ts +15 -0
- package/dist/cli/prompts.d.ts.map +1 -1
- package/dist/cli/prompts.js +89 -0
- package/dist/cli/prompts.js.map +1 -1
- package/dist/cli/skill-sync.d.ts +13 -0
- package/dist/cli/skill-sync.d.ts.map +1 -0
- package/dist/cli/skill-sync.js +234 -0
- package/dist/cli/skill-sync.js.map +1 -0
- package/dist/commands/config/command.d.ts.map +1 -1
- package/dist/commands/config/command.js +2 -1
- package/dist/commands/config/command.js.map +1 -1
- package/dist/commands/config/language.d.ts.map +1 -1
- package/dist/commands/config/language.js +3 -2
- package/dist/commands/config/language.js.map +1 -1
- package/dist/commands/error-handler.js +2 -2
- package/dist/commands/error-handler.js.map +1 -1
- package/dist/commands/error-presenter.d.ts.map +1 -1
- package/dist/commands/error-presenter.js +9 -1
- package/dist/commands/error-presenter.js.map +1 -1
- package/dist/commands/job-tracking.js +1 -1
- package/dist/commands/job-tracking.js.map +1 -1
- package/dist/commands/mappers.d.ts.map +1 -1
- package/dist/commands/mappers.js +4 -0
- package/dist/commands/mappers.js.map +1 -1
- package/dist/config/schemas.d.ts +2 -0
- package/dist/config/schemas.d.ts.map +1 -1
- package/dist/config/schemas.js +1 -0
- package/dist/config/schemas.js.map +1 -1
- package/dist/config/settings.js +1 -1
- package/dist/config/settings.js.map +1 -1
- package/dist/config/toml-io.d.ts.map +1 -1
- package/dist/config/toml-io.js +18 -5
- package/dist/config/toml-io.js.map +1 -1
- package/dist/errors/catalog.js +4 -4
- package/dist/errors/catalog.js.map +1 -1
- package/dist/errors/contracts.d.ts +2 -0
- package/dist/errors/contracts.d.ts.map +1 -1
- package/dist/errors/contracts.js +18 -0
- package/dist/errors/contracts.js.map +1 -1
- package/dist/i18n/catalog.d.ts +4 -6
- package/dist/i18n/catalog.d.ts.map +1 -1
- package/dist/i18n/catalog.js +4 -6
- package/dist/i18n/catalog.js.map +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +13 -1
- package/dist/index.js.map +1 -1
- package/dist/logging/external-transport.d.ts.map +1 -1
- package/dist/logging/external-transport.js +2 -1
- package/dist/logging/external-transport.js.map +1 -1
- package/dist/output/progress-display.d.ts.map +1 -1
- package/dist/output/progress-display.js +2 -4
- package/dist/output/progress-display.js.map +1 -1
- package/dist/output/terminal.js +1 -1
- package/dist/output/terminal.js.map +1 -1
- package/dist/output/usage-display.d.ts +6 -5
- package/dist/output/usage-display.d.ts.map +1 -1
- package/dist/output/usage-display.js +42 -33
- package/dist/output/usage-display.js.map +1 -1
- package/dist/output/view-models.d.ts +4 -0
- package/dist/output/view-models.d.ts.map +1 -1
- package/dist/repl/controller.d.ts.map +1 -1
- package/dist/repl/controller.js +8 -7
- package/dist/repl/controller.js.map +1 -1
- package/dist/repl/input/autocomplete-provider.d.ts +4 -0
- package/dist/repl/input/autocomplete-provider.d.ts.map +1 -1
- package/dist/repl/input/autocomplete-provider.js +7 -3
- package/dist/repl/input/autocomplete-provider.js.map +1 -1
- package/dist/repl/loop.d.ts.map +1 -1
- package/dist/repl/loop.js +6 -3
- package/dist/repl/loop.js.map +1 -1
- package/dist/repl/service.d.ts.map +1 -1
- package/dist/repl/service.js +3 -4
- package/dist/repl/service.js.map +1 -1
- package/dist/repl/ui/components/progress-bar.d.ts +1 -3
- package/dist/repl/ui/components/progress-bar.d.ts.map +1 -1
- package/dist/repl/ui/components/progress-bar.js +4 -18
- package/dist/repl/ui/components/progress-bar.js.map +1 -1
- package/dist/repl/ui/progress-controller.d.ts +0 -1
- package/dist/repl/ui/progress-controller.d.ts.map +1 -1
- package/dist/repl/ui/progress-controller.js +4 -19
- package/dist/repl/ui/progress-controller.js.map +1 -1
- package/dist/runtime/execution-mode.d.ts +6 -0
- package/dist/runtime/execution-mode.d.ts.map +1 -0
- package/dist/runtime/execution-mode.js +17 -0
- package/dist/runtime/execution-mode.js.map +1 -0
- package/dist/runtime/format-extensions.d.ts.map +1 -1
- package/dist/runtime/format-extensions.js +2 -1
- package/dist/runtime/format-extensions.js.map +1 -1
- package/dist/runtime/update-check.d.ts.map +1 -1
- package/dist/runtime/update-check.js +2 -1
- package/dist/runtime/update-check.js.map +1 -1
- package/dist/tui/settings-screen.d.ts.map +1 -1
- package/dist/tui/settings-screen.js +38 -8
- package/dist/tui/settings-screen.js.map +1 -1
- package/package.json +20 -2
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
# Prompsit CLI Skills
|
|
2
|
+
|
|
3
|
+
AI agent skills for the [Prompsit Translation API](https://prompsit.com) CLI.
|
|
4
|
+
|
|
5
|
+
Teach AI assistants (Claude Code, Codex CLI, Gemini CLI) how to use Prompsit CLI commands for translation, quality evaluation, corpus scoring, and data annotation.
|
|
6
|
+
|
|
7
|
+
## Installation
|
|
8
|
+
|
|
9
|
+
**As a Claude Code plugin:**
|
|
10
|
+
```bash
|
|
11
|
+
/plugin add Prompsit/prompsit-cli
|
|
12
|
+
```
|
|
13
|
+
|
|
14
|
+
**Bundled with CLI** (automatic on first launch):
|
|
15
|
+
```bash
|
|
16
|
+
npm install -g prompsit-cli
|
|
17
|
+
prompsit # prompts to install skills on first interactive launch
|
|
18
|
+
```
|
|
19
|
+
|
|
20
|
+
## Skills
|
|
21
|
+
|
|
22
|
+
| Skill | Description | When to Use |
|
|
23
|
+
|-------|-------------|-------------|
|
|
24
|
+
| `prompsit-setup` | Install CLI + request API token | Getting started, first-time setup |
|
|
25
|
+
| `prompsit-translate` | Translate text and documents | Text translation, document translation, format conversion |
|
|
26
|
+
| `prompsit-evaluate` | Evaluate translation quality | BLEU, chrF, MetricX scoring |
|
|
27
|
+
| `prompsit-score` | Score parallel corpora | Bicleaner quality scoring for TMX/TSV |
|
|
28
|
+
| `prompsit-annotate` | Annotate monolingual data | Monotextor metadata (language ID, doc scoring) |
|
|
29
|
+
|
|
30
|
+
## Requirements
|
|
31
|
+
|
|
32
|
+
- **Node.js** 22+
|
|
33
|
+
- **Playwright MCP** (optional) — for automated API token request via contact form
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: prompsit-annotate
|
|
3
|
+
description: |
|
|
4
|
+
Annotate monolingual data with Monotextor metadata using the Prompsit
|
|
5
|
+
Translation API. Use when the user needs language identification, PII detection,
|
|
6
|
+
deduplication, or text annotation.
|
|
7
|
+
license: Apache-2.0
|
|
8
|
+
---
|
|
9
|
+
|
|
10
|
+
# Prompsit Annotate
|
|
11
|
+
|
|
12
|
+
Annotate monolingual data with Monotextor metadata.
|
|
13
|
+
|
|
14
|
+
## Basic Usage
|
|
15
|
+
|
|
16
|
+
```bash
|
|
17
|
+
prompsit annotate corpus.jsonl -l en --metadata "lid,docscorer"
|
|
18
|
+
prompsit annotate corpus.jsonl -l es --metadata "lid,pii,dedup"
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
## Batch with Filters
|
|
22
|
+
|
|
23
|
+
```bash
|
|
24
|
+
prompsit annotate @"./data/" -l fr --metadata "lid" --min-len 100
|
|
25
|
+
prompsit annotate @"./data/" -l en --metadata "lid,pii" --min-avg-words 5
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
## Discovery
|
|
29
|
+
|
|
30
|
+
```bash
|
|
31
|
+
prompsit annotate --metadata # available metadata types
|
|
32
|
+
prompsit annotate --formats # supported file formats
|
|
33
|
+
```
|
|
34
|
+
|
|
35
|
+
## Flags
|
|
36
|
+
|
|
37
|
+
| Flag | Description |
|
|
38
|
+
|------|-------------|
|
|
39
|
+
| `-l, --lang <code>` | Language code |
|
|
40
|
+
| `--metadata [options]` | Metadata types to compute (comma-separated) |
|
|
41
|
+
| `--min-len <n>` | Minimum text length filter |
|
|
42
|
+
| `--min-avg-words <n>` | Minimum average words filter |
|
|
43
|
+
| `--lid-model <model>` | Language identification model |
|
|
44
|
+
| `--out <dir>` | Output directory |
|
|
45
|
+
| `--output-format <fmt>` | Output format |
|
|
46
|
+
| `--formats` | List supported file formats |
|
|
47
|
+
|
|
48
|
+
## Definition of Done
|
|
49
|
+
|
|
50
|
+
- [ ] Metadata annotations computed for all requested types
|
|
51
|
+
- [ ] Output files written to specified directory
|
|
52
|
+
|
|
53
|
+
---
|
|
54
|
+
**Version:** 1.0.0
|
|
55
|
+
**Last Updated:** 2026-03-13
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: prompsit-evaluate
|
|
3
|
+
description: |
|
|
4
|
+
Evaluate translation quality with metrics (BLEU, chrF, MetricX) using the
|
|
5
|
+
Prompsit Translation API. Use when the user needs quality evaluation, QE scores,
|
|
6
|
+
or translation metric comparisons.
|
|
7
|
+
license: Apache-2.0
|
|
8
|
+
---
|
|
9
|
+
|
|
10
|
+
# Prompsit Evaluate
|
|
11
|
+
|
|
12
|
+
Evaluate translation quality. Alias: `eval`.
|
|
13
|
+
|
|
14
|
+
## Inline Evaluation
|
|
15
|
+
|
|
16
|
+
```bash
|
|
17
|
+
prompsit evaluate -s "Hello" -h "Hola" -r "Hola" -m "bleu,chrf"
|
|
18
|
+
prompsit evaluate -s "Hello" -h "Hola" -r "Hola" -m "bleu,chrf,metricx"
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
## File Evaluation
|
|
22
|
+
|
|
23
|
+
TSV format: `source\thypothesis\treference` (tab-separated).
|
|
24
|
+
|
|
25
|
+
```bash
|
|
26
|
+
prompsit evaluate @"scores.tsv" -m "bleu,chrf,metricx"
|
|
27
|
+
```
|
|
28
|
+
|
|
29
|
+
## Document Evaluation
|
|
30
|
+
|
|
31
|
+
```bash
|
|
32
|
+
prompsit evaluate @"file.xlsx" -m "bleu" --out ./scored
|
|
33
|
+
```
|
|
34
|
+
|
|
35
|
+
## Discovery
|
|
36
|
+
|
|
37
|
+
```bash
|
|
38
|
+
prompsit evaluate --formats # supported file formats
|
|
39
|
+
```
|
|
40
|
+
|
|
41
|
+
## Flags
|
|
42
|
+
|
|
43
|
+
| Flag | Description |
|
|
44
|
+
|------|-------------|
|
|
45
|
+
| `-s, --source <text>` | Source text |
|
|
46
|
+
| `-h, --hypothesis <text>` | Translation hypothesis |
|
|
47
|
+
| `-r, --reference <text>` | Reference translation |
|
|
48
|
+
| `-m, --metrics <list>` | Comma-separated metric names |
|
|
49
|
+
| `--out <dir>` | Output directory |
|
|
50
|
+
| `--output-format <fmt>` | Output format |
|
|
51
|
+
| `--formats` | List supported file formats |
|
|
52
|
+
|
|
53
|
+
## Definition of Done
|
|
54
|
+
|
|
55
|
+
- [ ] Metric scores returned for all requested metrics
|
|
56
|
+
- [ ] Output files written to specified directory (file/document mode)
|
|
57
|
+
|
|
58
|
+
---
|
|
59
|
+
**Version:** 1.0.0
|
|
60
|
+
**Last Updated:** 2026-03-13
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: prompsit-score
|
|
3
|
+
description: |
|
|
4
|
+
Score parallel corpora with Bicleaner using the Prompsit Translation API.
|
|
5
|
+
Use when the user needs corpus quality scoring, parallel text cleaning,
|
|
6
|
+
or bilingual data filtering.
|
|
7
|
+
license: Apache-2.0
|
|
8
|
+
---
|
|
9
|
+
|
|
10
|
+
# Prompsit Score
|
|
11
|
+
|
|
12
|
+
Score parallel corpora with Bicleaner quality estimation.
|
|
13
|
+
|
|
14
|
+
## TMX Files
|
|
15
|
+
|
|
16
|
+
Auto-detects source and target languages from TMX metadata.
|
|
17
|
+
|
|
18
|
+
```bash
|
|
19
|
+
prompsit score corpus.tmx
|
|
20
|
+
prompsit score corpus.tmx --out ./scored
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
## Parallel TSV Files
|
|
24
|
+
|
|
25
|
+
Requires explicit source language.
|
|
26
|
+
|
|
27
|
+
```bash
|
|
28
|
+
prompsit score source.txt -t target.txt -s en
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
## Batch Scoring
|
|
32
|
+
|
|
33
|
+
```bash
|
|
34
|
+
prompsit score @"./corpora/" -t @"./targets/" -s en
|
|
35
|
+
```
|
|
36
|
+
|
|
37
|
+
## Discovery
|
|
38
|
+
|
|
39
|
+
```bash
|
|
40
|
+
prompsit score --languages # supported language pairs
|
|
41
|
+
prompsit score --formats # supported file formats
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
## Flags
|
|
45
|
+
|
|
46
|
+
| Flag | Description |
|
|
47
|
+
|------|-------------|
|
|
48
|
+
| `-s, --source-lang <lang>` | Source language code |
|
|
49
|
+
| `-t, --target <path>` | Target file path |
|
|
50
|
+
| `--out <dir>` | Output directory |
|
|
51
|
+
| `--output-format <fmt>` | Output format |
|
|
52
|
+
| `-l, --languages` | List supported language pairs |
|
|
53
|
+
| `--formats` | List supported file formats |
|
|
54
|
+
|
|
55
|
+
## Definition of Done
|
|
56
|
+
|
|
57
|
+
- [ ] Bicleaner scores returned for all input segments
|
|
58
|
+
- [ ] Output files written to specified directory
|
|
59
|
+
|
|
60
|
+
---
|
|
61
|
+
**Version:** 1.0.0
|
|
62
|
+
**Last Updated:** 2026-03-13
|
|
@@ -0,0 +1,146 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: prompsit-setup
|
|
3
|
+
description: |
|
|
4
|
+
Install Prompsit CLI and request API access via prompsit.com contact form.
|
|
5
|
+
Use when the user wants to set up Prompsit Translation API for the first time.
|
|
6
|
+
license: Apache-2.0
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
# Prompsit Setup
|
|
10
|
+
|
|
11
|
+
Install Prompsit CLI and get API access for the Prompsit Translation API.
|
|
12
|
+
|
|
13
|
+
**Capabilities:** text/document translation, quality evaluation (QE), parallel corpus scoring (Bicleaner), monolingual data annotation (Monotextor).
|
|
14
|
+
|
|
15
|
+
**Related skills:** `prompsit-translate`, `prompsit-evaluate`, `prompsit-score`, `prompsit-annotate`.
|
|
16
|
+
|
|
17
|
+
## When to Use
|
|
18
|
+
|
|
19
|
+
- User wants to install Prompsit CLI
|
|
20
|
+
- User needs API credentials for the Prompsit Translation API
|
|
21
|
+
- User asks "how to get started with Prompsit"
|
|
22
|
+
- User asks about login, authentication, or setup
|
|
23
|
+
|
|
24
|
+
## Workflow
|
|
25
|
+
|
|
26
|
+
Execute phases sequentially. Skip completed phases (e.g. if CLI is already installed, skip Phase 1).
|
|
27
|
+
|
|
28
|
+
### Phase 1: Install CLI
|
|
29
|
+
|
|
30
|
+
1. Check if already installed:
|
|
31
|
+
```bash
|
|
32
|
+
prompsit --version
|
|
33
|
+
```
|
|
34
|
+
2. If not found, install globally:
|
|
35
|
+
```bash
|
|
36
|
+
npm install -g prompsit-cli
|
|
37
|
+
```
|
|
38
|
+
Alternative (no global install): `npx prompsit-cli`
|
|
39
|
+
3. Verify installation: `prompsit --version` must print a version string.
|
|
40
|
+
|
|
41
|
+
### Phase 2: Request API Token
|
|
42
|
+
|
|
43
|
+
The user needs API credentials. Use the contact form at prompsit.com to request access.
|
|
44
|
+
|
|
45
|
+
**Ask the user for their email address** before proceeding.
|
|
46
|
+
|
|
47
|
+
#### With Playwright MCP (preferred)
|
|
48
|
+
|
|
49
|
+
Use browser automation to fill and submit the contact form:
|
|
50
|
+
|
|
51
|
+
1. **Navigate:**
|
|
52
|
+
```
|
|
53
|
+
mcp__playwright__browser_navigate url="https://prompsit.com/en/contact"
|
|
54
|
+
```
|
|
55
|
+
|
|
56
|
+
2. **Snapshot** to verify page loaded:
|
|
57
|
+
```
|
|
58
|
+
mcp__playwright__browser_snapshot
|
|
59
|
+
```
|
|
60
|
+
|
|
61
|
+
3. **Dismiss cookie banner** (if present): click "Accept all" button.
|
|
62
|
+
```
|
|
63
|
+
mcp__playwright__browser_click element="Accept all"
|
|
64
|
+
```
|
|
65
|
+
|
|
66
|
+
4. **Fill email field** (textbox, placeholder "hi@"):
|
|
67
|
+
```
|
|
68
|
+
mcp__playwright__browser_fill_form formData=[{"selector": "[placeholder='hi@']", "value": "{user_email}"}]
|
|
69
|
+
```
|
|
70
|
+
|
|
71
|
+
5. **Fill message field** (textbox, placeholder "Enter your message", min 10 chars):
|
|
72
|
+
```
|
|
73
|
+
mcp__playwright__browser_fill_form formData=[{"selector": "[placeholder='Enter your message']", "value": "Hello, I would like to request API access for the Prompsit Translation API CLI. My email: {user_email}. Thank you."}]
|
|
74
|
+
```
|
|
75
|
+
|
|
76
|
+
6. **Click Send:**
|
|
77
|
+
```
|
|
78
|
+
mcp__playwright__browser_click element="Send"
|
|
79
|
+
```
|
|
80
|
+
|
|
81
|
+
7. **Verify submission:** snapshot should show "Thank you! We will get back to you soon."
|
|
82
|
+
|
|
83
|
+
#### Without Playwright MCP (fallback)
|
|
84
|
+
|
|
85
|
+
If browser MCP tools are unavailable:
|
|
86
|
+
|
|
87
|
+
1. Open in the user's browser: `https://prompsit.com/en/contact`
|
|
88
|
+
2. Instruct the user to fill in:
|
|
89
|
+
- **Email:** their email address
|
|
90
|
+
- **Message:** "Hello, I would like to request API access for the Prompsit Translation API CLI. My email: {email}. Thank you."
|
|
91
|
+
3. Click **Send** and wait for confirmation email.
|
|
92
|
+
|
|
93
|
+
### Phase 3: Authenticate
|
|
94
|
+
|
|
95
|
+
Once the user has received their API credentials (account email + secret key):
|
|
96
|
+
|
|
97
|
+
1. Run interactive login (prompts for email and secret):
|
|
98
|
+
```bash
|
|
99
|
+
prompsit login
|
|
100
|
+
```
|
|
101
|
+
2. Verify connectivity:
|
|
102
|
+
```bash
|
|
103
|
+
prompsit health
|
|
104
|
+
```
|
|
105
|
+
## Configuration Reference
|
|
106
|
+
|
|
107
|
+
Settings stored in `~/.prompsit/config.toml`. Credentials in `~/.prompsit/credentials.json`.
|
|
108
|
+
|
|
109
|
+
```bash
|
|
110
|
+
prompsit config show # show all settings with sources
|
|
111
|
+
prompsit config <key> # get value
|
|
112
|
+
prompsit config <key> <value> # set value
|
|
113
|
+
prompsit config api-url [preset|url] # set API URL (presets: production, test, edge, local)
|
|
114
|
+
prompsit config language [code] # set UI language
|
|
115
|
+
prompsit config reset [-f] # reset config and credentials
|
|
116
|
+
```
|
|
117
|
+
|
|
118
|
+
**Precedence:** Environment variables (`PROMPSIT_*`) > config.toml > defaults. Nested keys use `__` delimiter (e.g. `PROMPSIT_API__BASE_URL`).
|
|
119
|
+
|
|
120
|
+
## System Commands
|
|
121
|
+
|
|
122
|
+
```bash
|
|
123
|
+
prompsit health # check API connectivity
|
|
124
|
+
prompsit usage # daily API usage statistics
|
|
125
|
+
prompsit # interactive REPL with tab-completion
|
|
126
|
+
```
|
|
127
|
+
|
|
128
|
+
## Error Handling
|
|
129
|
+
|
|
130
|
+
| Error | Resolution |
|
|
131
|
+
|-------|------------|
|
|
132
|
+
| 401 Unauthorized | Run `prompsit login` |
|
|
133
|
+
| 429 Rate Limited | CLI auto-waits up to `rate-limit-max-wait` (default: 300s) |
|
|
134
|
+
| Cold start timeout | API engines warm up; CLI retries up to `warmup-timeout` (default: 120s) |
|
|
135
|
+
| Job timeout | Long document jobs timeout after `job-timeout` (default: 600s) |
|
|
136
|
+
|
|
137
|
+
## Definition of Done
|
|
138
|
+
|
|
139
|
+
- [ ] CLI installed and `prompsit --version` returns a version
|
|
140
|
+
- [ ] API token request submitted (or user already has credentials)
|
|
141
|
+
- [ ] `prompsit login` succeeds
|
|
142
|
+
- [ ] `prompsit health` returns OK
|
|
143
|
+
|
|
144
|
+
---
|
|
145
|
+
**Version:** 1.0.0
|
|
146
|
+
**Last Updated:** 2026-03-13
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: prompsit-translate
|
|
3
|
+
description: |
|
|
4
|
+
Translate text and documents using the Prompsit Translation API.
|
|
5
|
+
Use when the user needs machine translation, document translation,
|
|
6
|
+
batch file translation, or quality estimation on translations.
|
|
7
|
+
license: Apache-2.0
|
|
8
|
+
---
|
|
9
|
+
|
|
10
|
+
# Prompsit Translate
|
|
11
|
+
|
|
12
|
+
Translate text or documents via the Prompsit API. Prefix `@` for file/directory mode.
|
|
13
|
+
|
|
14
|
+
## Text Translation
|
|
15
|
+
|
|
16
|
+
```bash
|
|
17
|
+
prompsit translate "Hello world" -s en -t es
|
|
18
|
+
prompsit translate "Hello" "Goodbye" -s en -t de # multiple texts
|
|
19
|
+
prompsit translate "Hello" -s en -t es --qe # with quality estimation
|
|
20
|
+
```
|
|
21
|
+
|
|
22
|
+
## Document Translation
|
|
23
|
+
|
|
24
|
+
Async job with SSE progress tracking.
|
|
25
|
+
|
|
26
|
+
```bash
|
|
27
|
+
prompsit translate @"file.docx" -s en -t fr --out ./output
|
|
28
|
+
prompsit translate @"./docs/" -s en -t pt # batch directory
|
|
29
|
+
prompsit translate @"file.po" -s en -t pt --output-format arb # format conversion
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
## Discovery
|
|
33
|
+
|
|
34
|
+
```bash
|
|
35
|
+
prompsit translate --formats # supported file formats
|
|
36
|
+
prompsit translate --languages # available language pairs
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
## Flags
|
|
40
|
+
|
|
41
|
+
| Flag | Description |
|
|
42
|
+
|------|-------------|
|
|
43
|
+
| `-s, --source <lang>` | Source language code |
|
|
44
|
+
| `-t, --target <lang>` | Target language code |
|
|
45
|
+
| `--qe` | Include quality estimation scores |
|
|
46
|
+
| `--out <dir>` | Output directory for documents |
|
|
47
|
+
| `--output-format <fmt>` | Convert output format |
|
|
48
|
+
| `-l, --languages` | List available language pairs |
|
|
49
|
+
| `--formats` | List supported file formats |
|
|
50
|
+
|
|
51
|
+
## Workflow Example
|
|
52
|
+
|
|
53
|
+
```bash
|
|
54
|
+
prompsit login # interactive auth
|
|
55
|
+
prompsit translate @"./input/" -s en -t es --out ./output
|
|
56
|
+
```
|
|
57
|
+
|
|
58
|
+
## Definition of Done
|
|
59
|
+
|
|
60
|
+
- [ ] Translation output matches expected language pair
|
|
61
|
+
- [ ] Output files written to specified directory (document mode)
|
|
62
|
+
|
|
63
|
+
---
|
|
64
|
+
**Version:** 1.0.0
|
|
65
|
+
**Last Updated:** 2026-03-13
|
package/dist/api/auth-session.js
CHANGED
|
@@ -53,7 +53,7 @@ export class AuthSession {
|
|
|
53
53
|
const refreshed = await this.tryRefresh();
|
|
54
54
|
if (!refreshed) {
|
|
55
55
|
clearTokens();
|
|
56
|
-
throw new AuthenticationError("Session expired.
|
|
56
|
+
throw new AuthenticationError("Session expired.");
|
|
57
57
|
}
|
|
58
58
|
}
|
|
59
59
|
// 3. Execute with auth
|
|
@@ -68,7 +68,7 @@ export class AuthSession {
|
|
|
68
68
|
return await fn(false, signal);
|
|
69
69
|
}
|
|
70
70
|
clearTokens();
|
|
71
|
-
throw new AuthenticationError("Authentication failed.
|
|
71
|
+
throw new AuthenticationError("Authentication failed.");
|
|
72
72
|
}
|
|
73
73
|
throw error;
|
|
74
74
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"auth-session.js","sourceRoot":"","sources":["../../src/api/auth-session.ts"],"names":[],"mappings":"AAAA,oEAAoE;AACpE,qFAAqF;AACrF,iFAAiF;AAIjF,OAAO,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AACnD,OAAO,EAAE,mBAA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ACtC,SAAS,EAAE,QAAQ,CAAC,UAAU,IAAI,SAAS;gBAC3C,IAAI,EAAE,QAAQ,CAAC,IAAI;aACpB,CAAC,CAAC;YAEH,0CAA0C;YAC1C,IAAI,CAAC,SAAS,CAAC,eAAe,EAAE,CAAC;YAEjC,OAAO,IAAI,CAAC;QACd,CAAC;QAAC,OAAO,KAAc,EAAE,CAAC;YACxB,yDAAyD;YACzD,IAAI,KAAK,YAAY,mBAAmB,EAAE,CAAC;gBACzC,OAAO,KAAK,CAAC;YACf,CAAC;YACD,oEAAoE;YACpE,IAAI,KAAK,YAAY,YAAY,IAAI,KAAK,YAAY,WAAW,EAAE,CAAC;gBAClE,MAAM,KAAK,CAAC;YACd,CAAC;YACD,uCAAuC;YACvC,OAAO,KAAK,CAAC;QACf,CAAC;IACH,CAAC;CACF"}
|
package/dist/api/errors.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"errors.d.ts","sourceRoot":"","sources":["../../src/api/errors.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"errors.d.ts","sourceRoot":"","sources":["../../src/api/errors.ts"],"names":[],"mappings":"AAEA,OAAO,EACL,QAAQ,EAOT,MAAM,wBAAwB,CAAC;AAQhC,wBAAgB,aAAa,CAAC,YAAY,EAAE,OAAO,EAAE,UAAU,EAAE,MAAM,GAAG,QAAQ,CA8EjF;AAkBD,OAAO,EACL,cAAc,EACd,YAAY,EACZ,QAAQ,EACR,mBAAmB,EACnB,cAAc,EACd,WAAW,GACZ,MAAM,wBAAwB,CAAC"}
|
package/dist/api/errors.js
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
// See API-442: Error hierarchy with codes & RFC 9457 ProblemDetail
|
|
2
|
+
import { STATUS_CODES } from "node:http";
|
|
2
3
|
import { APIError, AuthenticationError, ForbiddenError, ProblemDetailSchema, RateLimitError, ServerError, ValidationError, } from "../errors/contracts.js";
|
|
3
4
|
import { HttpStatus } from "../shared/constants.js";
|
|
4
5
|
// Re-export only symbols that external consumers actually import.
|
|
@@ -6,14 +7,15 @@ import { HttpStatus } from "../shared/constants.js";
|
|
|
6
7
|
// Parse API response and return appropriate exception
|
|
7
8
|
// Supports RFC 9457 ProblemDetail format with fallback payload normalization.
|
|
8
9
|
export function parseApiError(responseData, statusCode) {
|
|
10
|
+
// Null/undefined guard — HTTP error with non-JSON body (e.g. nginx HTML, empty response)
|
|
11
|
+
if (responseData === null || responseData === undefined) {
|
|
12
|
+
return mapStatusToError(statusCode, httpStatusMessage(statusCode));
|
|
13
|
+
}
|
|
9
14
|
// Check for RFC 9457 ProblemDetail format
|
|
10
|
-
if (typeof responseData === "object" &&
|
|
11
|
-
responseData !== null &&
|
|
12
|
-
"type" in responseData &&
|
|
13
|
-
"code" in responseData) {
|
|
15
|
+
if (typeof responseData === "object" && "type" in responseData && "code" in responseData) {
|
|
14
16
|
try {
|
|
15
17
|
const problem = ProblemDetailSchema.parse(responseData);
|
|
16
|
-
const detail = problem.detail ?? "API error";
|
|
18
|
+
const detail = problem.detail ?? problem.title ?? "API error";
|
|
17
19
|
// Map error codes to specific exception types (prefix-based)
|
|
18
20
|
if (problem.code?.startsWith("AUTH_")) {
|
|
19
21
|
return new AuthenticationError(detail);
|
|
@@ -42,9 +44,7 @@ export function parseApiError(responseData, statusCode) {
|
|
|
42
44
|
}
|
|
43
45
|
}
|
|
44
46
|
// Check for FastAPI detail format
|
|
45
|
-
if (typeof responseData === "object" &&
|
|
46
|
-
responseData !== null &&
|
|
47
|
-
"detail" in responseData) {
|
|
47
|
+
if (typeof responseData === "object" && "detail" in responseData) {
|
|
48
48
|
const { detail } = responseData;
|
|
49
49
|
// detail can be a string or list of validation errors
|
|
50
50
|
if (Array.isArray(detail) && detail.length > 0) {
|
|
@@ -61,8 +61,8 @@ export function parseApiError(responseData, statusCode) {
|
|
|
61
61
|
if (typeof responseData === "string") {
|
|
62
62
|
return mapStatusToError(statusCode, responseData);
|
|
63
63
|
}
|
|
64
|
-
// Last resort fallback
|
|
65
|
-
return mapStatusToError(statusCode,
|
|
64
|
+
// Last resort fallback — structured data we can't parse
|
|
65
|
+
return mapStatusToError(statusCode, httpStatusMessage(statusCode));
|
|
66
66
|
}
|
|
67
67
|
// Map HTTP status code to the appropriate error class instance
|
|
68
68
|
function mapStatusToError(statusCode, message) {
|
|
@@ -78,5 +78,8 @@ function mapStatusToError(statusCode, message) {
|
|
|
78
78
|
return new ServerError(message, statusCode);
|
|
79
79
|
return new APIError(message, `E${statusCode}`, statusCode);
|
|
80
80
|
}
|
|
81
|
+
function httpStatusMessage(statusCode) {
|
|
82
|
+
return STATUS_CODES[statusCode] ?? `HTTP error ${statusCode}`;
|
|
83
|
+
}
|
|
81
84
|
export { CancelledError, NetworkError, APIError, AuthenticationError, RateLimitError, ServerError, } from "../errors/contracts.js";
|
|
82
85
|
//# sourceMappingURL=errors.js.map
|
package/dist/api/errors.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"errors.js","sourceRoot":"","sources":["../../src/api/errors.ts"],"names":[],"mappings":"AAAA,mEAAmE;AACnE,OAAO,EACL,QAAQ,EACR,mBAAmB,EACnB,cAAc,EACd,mBAAmB,EACnB,cAAc,EACd,WAAW,EACX,eAAe,GAChB,MAAM,wBAAwB,CAAC;AAChC,OAAO,EAAE,UAAU,EAAE,MAAM,wBAAwB,CAAC;AAEpD,kEAAkE;AAClE,+FAA+F;AAE/F,sDAAsD;AACtD,8EAA8E;AAC9E,MAAM,UAAU,aAAa,CAAC,YAAqB,EAAE,UAAkB;IACrE,
|
|
1
|
+
{"version":3,"file":"errors.js","sourceRoot":"","sources":["../../src/api/errors.ts"],"names":[],"mappings":"AAAA,mEAAmE;AACnE,OAAO,EAAE,YAAY,EAAE,MAAM,WAAW,CAAC;AACzC,OAAO,EACL,QAAQ,EACR,mBAAmB,EACnB,cAAc,EACd,mBAAmB,EACnB,cAAc,EACd,WAAW,EACX,eAAe,GAChB,MAAM,wBAAwB,C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C;IACpD,CAAC;IAED,wDAAwD;IACxD,OAAO,gBAAgB,CAAC,UAAU,EAAE,iBAAiB,CAAC,UAAU,CAAC,CAAC,CAAC;AACrE,CAAC;AAED,+DAA+D;AAC/D,SAAS,gBAAgB,CAAC,UAAkB,EAAE,OAAe;IAC3D,IAAI,UAAU,KAAK,UAAU,CAAC,YAAY;QAAE,OAAO,IAAI,mBAAmB,CAAC,OAAO,CAAC,CAAC;IACpF,IAAI,UAAU,KAAK,UAAU,CAAC,SAAS;QAAE,OAAO,IAAI,cAAc,CAAC,OAAO,CAAC,CAAC;IAC5E,IAAI,UAAU,KAAK,UAAU,CAAC,YAAY;QAAE,OAAO,IAAI,cAAc,CAAC,OAAO,CAAC,CAAC;IAC/E,IAAI,UAAU,KAAK,UAAU,CAAC,aAAa;QACzC,OAAO,IAAI,eAAe,CAAC,CAAC,EAAE,IAAI,EAAE,aAAa,EAAE,GAAG,EAAE,EAAE,EAAE,GAAG,EAAE,OAAO,EAAE,CAAC,CAAC,CAAC;IAC/E,IAAI,UAAU,IAAI,UAAU,CAAC,cAAc;QAAE,OAAO,IAAI,WAAW,CAAC,OAAO,EAAE,UAAU,CAAC,CAAC;IAEzF,OAAO,IAAI,QAAQ,CAAC,OAAO,EAAE,IAAI,UAAU,EAAE,EAAE,UAAU,CAAC,CAAC;AAC7D,CAAC;AAED,SAAS,iBAAiB,CAAC,UAAkB;IAC3C,OAAO,YAAY,CAAC,UAAU,CAAC,IAAI,cAAc,UAAU,EAAE,CAAC;AAChE,CAAC;AAED,OAAO,EACL,cAAc,EACd,YAAY,EACZ,QAAQ,EACR,mBAAmB,EACnB,cAAc,EACd,WAAW,GACZ,MAAM,wBAAwB,CAAC"}
|
package/dist/api/models.d.ts
CHANGED
|
@@ -244,16 +244,24 @@ export declare const DataJobCreateResponseSchema: z.ZodObject<{
|
|
|
244
244
|
export declare const TierInfoSchema: z.ZodObject<{
|
|
245
245
|
name: z.ZodString;
|
|
246
246
|
chars_daily_limit: z.ZodNumber;
|
|
247
|
+
corpus_bytes_daily_limit: z.ZodNumber;
|
|
247
248
|
rpm_limit: z.ZodNumber;
|
|
248
249
|
segment_limit: z.ZodNullable<z.ZodNumber>;
|
|
249
250
|
}, z.core.$strip>;
|
|
250
|
-
/** Daily character usage from GET /v1/user/usage. */
|
|
251
|
+
/** Daily character usage (translation + QE pool) from GET /v1/user/usage. */
|
|
251
252
|
export declare const DailyUsageSchema: z.ZodObject<{
|
|
252
253
|
chars_used: z.ZodNumber;
|
|
253
254
|
chars_limit: z.ZodNumber;
|
|
254
255
|
percentage: z.ZodNumber;
|
|
255
256
|
reset_at: z.ZodString;
|
|
256
257
|
}, z.core.$strip>;
|
|
258
|
+
/** Daily corpus byte usage (annotation pool) from GET /v1/user/usage. */
|
|
259
|
+
export declare const CorpusUsageSchema: z.ZodObject<{
|
|
260
|
+
bytes_used: z.ZodNumber;
|
|
261
|
+
bytes_limit: z.ZodNumber;
|
|
262
|
+
percentage: z.ZodNumber;
|
|
263
|
+
reset_at: z.ZodString;
|
|
264
|
+
}, z.core.$strip>;
|
|
257
265
|
/** Subscription info from GET /v1/user/usage. */
|
|
258
266
|
export declare const SubscriptionInfoSchema: z.ZodObject<{
|
|
259
267
|
active: z.ZodBoolean;
|
|
@@ -263,10 +271,9 @@ export declare const SubscriptionInfoSchema: z.ZodObject<{
|
|
|
263
271
|
/**
|
|
264
272
|
* User usage response from GET /v1/user/usage.
|
|
265
273
|
*
|
|
266
|
-
*
|
|
267
|
-
* -
|
|
268
|
-
* -
|
|
269
|
-
* - subscription: Subscription status and dates
|
|
274
|
+
* Two usage pools:
|
|
275
|
+
* - daily_usage: character usage (translation + QE)
|
|
276
|
+
* - corpus_usage: byte usage (annotation)
|
|
270
277
|
*
|
|
271
278
|
* Matches app/schemas/user.py in prompsit-api.
|
|
272
279
|
*/
|
|
@@ -274,6 +281,7 @@ export declare const UserUsageResponseSchema: z.ZodObject<{
|
|
|
274
281
|
tier: z.ZodObject<{
|
|
275
282
|
name: z.ZodString;
|
|
276
283
|
chars_daily_limit: z.ZodNumber;
|
|
284
|
+
corpus_bytes_daily_limit: z.ZodNumber;
|
|
277
285
|
rpm_limit: z.ZodNumber;
|
|
278
286
|
segment_limit: z.ZodNullable<z.ZodNumber>;
|
|
279
287
|
}, z.core.$strip>;
|
|
@@ -283,6 +291,12 @@ export declare const UserUsageResponseSchema: z.ZodObject<{
|
|
|
283
291
|
percentage: z.ZodNumber;
|
|
284
292
|
reset_at: z.ZodString;
|
|
285
293
|
}, z.core.$strip>;
|
|
294
|
+
corpus_usage: z.ZodObject<{
|
|
295
|
+
bytes_used: z.ZodNumber;
|
|
296
|
+
bytes_limit: z.ZodNumber;
|
|
297
|
+
percentage: z.ZodNumber;
|
|
298
|
+
reset_at: z.ZodString;
|
|
299
|
+
}, z.core.$strip>;
|
|
286
300
|
subscription: z.ZodObject<{
|
|
287
301
|
active: z.ZodBoolean;
|
|
288
302
|
start_date: z.ZodString;
|
package/dist/api/models.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"models.d.ts","sourceRoot":"","sources":["../../src/api/models.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB;;;;;;;;;;;GAWG;AACH,eAAO,MAAM,mBAAmB;;;;;;;iBAO9B,CAAC;AAEH;;;;;;;;;;;;GAYG;AACH,eAAO,MAAM,uBAAuB;;;;iBAIlC,CAAC;AAEH,eAAO,MAAM,oBAAoB;;;;;;;;;;;iBAO/B,CAAC;AAIH;;;;;;;;;;GAUG;AACH,eAAO,MAAM,qBAAqB;;;;;iBAKhC,CAAC;AAEH;;;;;;;;;;;GAWG;AACH,eAAO,MAAM,yBAAyB;;;;;;;;;;;iBAMpC,CAAC;AAIH;;;;;;;;;GASG;AACH,eAAO,MAAM,aAAa;;;;iBAIxB,CAAC;AAEH;;;;;;;;;GASG;AACH,eAAO,MAAM,wBAAwB;;;;iBAInC,CAAC;AAIH,8CAA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,cAAc,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,oBAAoB,CAAC,CAAC;AAClE,MAAM,MAAM,mBAAmB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,yBAAyB,CAAC,CAAC;AAC5E,MAAM,MAAM,OAAO,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,aAAa,CAAC,CAAC;AACpD,MAAM,MAAM,kBAAkB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,wBAAwB,CAAC,CAAC;AAC1E,MAAM,MAAM,kBAAkB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,wBAAwB,CAAC,CAAC;AAC1E,MAAM,MAAM,UAAU,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,gBAAgB,CAAC,CAAC;AAC1D,MAAM,MAAM,eAAe,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,qBAAqB,CAAC,CAAC;AACpE,MAAM,MAAM,iBAAiB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,uBAAuB,CAAC,CAAC;AACxE,MAAM,MAAM,oBAAoB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,0BAA0B,CAAC,CAAC;AAC9E,MAAM,MAAM,qBAAqB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,2BAA2B,CAAC,CAAC;AAChF,MAAM,MAAM,iBAAiB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,uBAAuB,CAAC,CAAC"}
|
package/dist/api/models.js
CHANGED
|
@@ -232,16 +232,24 @@ export const DataJobCreateResponseSchema = z.object({
|
|
|
232
232
|
export const TierInfoSchema = z.object({
|
|
233
233
|
name: z.string(),
|
|
234
234
|
chars_daily_limit: z.number(),
|
|
235
|
+
corpus_bytes_daily_limit: z.number(),
|
|
235
236
|
rpm_limit: z.number(),
|
|
236
237
|
segment_limit: z.number().nullable(),
|
|
237
238
|
});
|
|
238
|
-
/** Daily character usage from GET /v1/user/usage. */
|
|
239
|
+
/** Daily character usage (translation + QE pool) from GET /v1/user/usage. */
|
|
239
240
|
export const DailyUsageSchema = z.object({
|
|
240
241
|
chars_used: z.number(),
|
|
241
242
|
chars_limit: z.number(),
|
|
242
243
|
percentage: z.number(),
|
|
243
244
|
reset_at: z.string(),
|
|
244
245
|
});
|
|
246
|
+
/** Daily corpus byte usage (annotation pool) from GET /v1/user/usage. */
|
|
247
|
+
export const CorpusUsageSchema = z.object({
|
|
248
|
+
bytes_used: z.number(),
|
|
249
|
+
bytes_limit: z.number(),
|
|
250
|
+
percentage: z.number(),
|
|
251
|
+
reset_at: z.string(),
|
|
252
|
+
});
|
|
245
253
|
/** Subscription info from GET /v1/user/usage. */
|
|
246
254
|
export const SubscriptionInfoSchema = z.object({
|
|
247
255
|
active: z.boolean(),
|
|
@@ -251,16 +259,16 @@ export const SubscriptionInfoSchema = z.object({
|
|
|
251
259
|
/**
|
|
252
260
|
* User usage response from GET /v1/user/usage.
|
|
253
261
|
*
|
|
254
|
-
*
|
|
255
|
-
* -
|
|
256
|
-
* -
|
|
257
|
-
* - subscription: Subscription status and dates
|
|
262
|
+
* Two usage pools:
|
|
263
|
+
* - daily_usage: character usage (translation + QE)
|
|
264
|
+
* - corpus_usage: byte usage (annotation)
|
|
258
265
|
*
|
|
259
266
|
* Matches app/schemas/user.py in prompsit-api.
|
|
260
267
|
*/
|
|
261
268
|
export const UserUsageResponseSchema = z.object({
|
|
262
269
|
tier: TierInfoSchema,
|
|
263
270
|
daily_usage: DailyUsageSchema,
|
|
271
|
+
corpus_usage: CorpusUsageSchema,
|
|
264
272
|
subscription: SubscriptionInfoSchema,
|
|
265
273
|
});
|
|
266
274
|
//# sourceMappingURL=models.js.map
|