@1endpoint/coding-helper 0.1.3 → 0.1.4
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/README.md +5 -8
- package/package.json +1 -1
- package/src/cli.mjs +1 -1
- package/src/ui.mjs +3 -17
package/README.md
CHANGED
|
@@ -19,10 +19,9 @@ npx @1endpoint/coding-helper
|
|
|
19
19
|
1. Choose **English** or **Tiếng Việt**.
|
|
20
20
|
2. Choose **Setup**.
|
|
21
21
|
3. Select **DSH** or **Claude Code**.
|
|
22
|
-
4. Paste your API key
|
|
23
|
-
5.
|
|
24
|
-
6.
|
|
25
|
-
7. Review the selection, then choose **Confirm**.
|
|
22
|
+
4. Paste your API key, or select **Open Console** and press Enter to create a key first.
|
|
23
|
+
5. Select models from the 1endpoint catalog.
|
|
24
|
+
6. Review the selection, then choose **Confirm**. The key is saved automatically for the selected tool.
|
|
26
25
|
|
|
27
26
|
Use **↑ / ↓** to move and **Enter** to select. Press **Escape** to cancel. Confirmation is a selection, not a typed `y/n` answer.
|
|
28
27
|
|
|
@@ -40,11 +39,9 @@ Paste your key directly into the helper's **masked API-key prompt**. The key is
|
|
|
40
39
|
|
|
41
40
|
Need a key? Select **Open Console** and press **Enter**. The helper opens [API keys](https://console.1endpoint.dev/api-keys), or the [Vietnamese API-key page](https://console.1endpoint.dev/vi/api-keys) when Vietnamese is selected. Create a key, copy it, return to the terminal and paste it into the prompt.
|
|
42
41
|
|
|
43
|
-
|
|
42
|
+
The key is saved automatically for the selected tool when setup or reconfiguration is confirmed. There is no storage-choice prompt. A key entered while starting a tool is also saved for future launches.
|
|
44
43
|
|
|
45
|
-
|
|
46
|
-
- **This session only:** keep it in memory for this helper process. After setup, select **Start a new session now** to launch with it. Reopening the helper later requires entering the key again.
|
|
47
|
-
- **Use an existing key:** reuse an available environment or saved key without displaying its value.
|
|
44
|
+
The saved file is plaintext, **not encrypted**, protected with private file permissions (0600 file, 0700 directory on POSIX systems). Other processes running as your user may still access it. Keys are never displayed. If a key is already available, select **Use an existing key** to reuse it.
|
|
48
45
|
|
|
49
46
|
DSH and Claude Code store their keys separately. An explicit session key takes priority, followed by `ONEENDPOINT_API_KEY`, then the selected tool's saved key. The helper never puts keys in generated tool settings, model configuration, backups or logs.
|
|
50
47
|
|
package/package.json
CHANGED
package/src/cli.mjs
CHANGED
|
@@ -26,7 +26,7 @@ Claude setup/reconfigure accepts --haiku-model ID --sonnet-model ID --opus-model
|
|
|
26
26
|
and optional --fable-model ID for supporting versions. --model is the main/default fallback.
|
|
27
27
|
Node.js >=22.19 is required.
|
|
28
28
|
Paste your API key privately in the menu, or press Enter on Open Console to create one.
|
|
29
|
-
|
|
29
|
+
Pasted keys are saved automatically for the selected tool. Saved files are private plaintext, not encrypted.
|
|
30
30
|
ONEENDPOINT_API_KEY remains an optional environment override; never pass keys as arguments.
|
|
31
31
|
State: ONEENDPOINT_HELPER_HOME or ~/.1endpoint/coding-helper (isolated tool homes).
|
|
32
32
|
No existing DSH/Claude settings are edited. Setup/doctor make no API requests.
|
package/src/ui.mjs
CHANGED
|
@@ -199,7 +199,7 @@ export async function readApiKey({ input = process.stdin, output = process.stdou
|
|
|
199
199
|
for (const event of ['error', 'end', 'close']) input.on(event, onFailure)
|
|
200
200
|
output.on('error', onFailure)
|
|
201
201
|
input.setRawMode(true)
|
|
202
|
-
output.write('\u001b[?2004h' + (language === 'vi' ? 'Dán khóa API
|
|
202
|
+
output.write('\u001b[?2004h' + (language === 'vi' ? 'Dán khóa API: ' : 'Paste API key: '))
|
|
203
203
|
input.resume()
|
|
204
204
|
} catch { finish(uiError()) }
|
|
205
205
|
})
|
|
@@ -263,7 +263,7 @@ export async function wizard({ dispatch, input = process.stdin, output = process
|
|
|
263
263
|
if (action !== 'run' || !available) {
|
|
264
264
|
while (true) {
|
|
265
265
|
const keyAction = await choose(t('API key', 'Khóa API'), [
|
|
266
|
-
{ label: t('Paste key
|
|
266
|
+
{ label: t('Paste API key', 'Dán khóa API'), value: 'paste' },
|
|
267
267
|
{ label: t('Open Console create API key', 'Mở Console tạo khóa API'), value: 'open', description: t('Enter opens the API keys page', 'Enter mở trang khóa API') },
|
|
268
268
|
...(available ? [{ label: t('Use existing saved/environment key', 'Dùng khóa đã lưu hoặc biến môi trường'), value: 'existing' }] : []),
|
|
269
269
|
{ label: t('Skip; use environment key later', 'Bỏ qua; dùng khóa môi trường sau'), value: 'skip' },
|
|
@@ -283,13 +283,7 @@ export async function wizard({ dispatch, input = process.stdin, output = process
|
|
|
283
283
|
output.write(error.message + '\n'); continue
|
|
284
284
|
}
|
|
285
285
|
output.write(t('Local keys are plaintext, mode 0600: accessible to your user account, not encrypted.\n', 'Khóa cục bộ ở dạng văn bản thuần, quyền 0600: tài khoản của bạn có thể đọc, không được mã hóa.\n'))
|
|
286
|
-
|
|
287
|
-
{ label: t('Save locally', 'Lưu cục bộ'), value: 'save' },
|
|
288
|
-
{ label: t('This run only', 'Chỉ lần chạy này'), value: 'session' },
|
|
289
|
-
{ label: t('Cancel', 'Hủy'), value: 'cancel' }
|
|
290
|
-
])
|
|
291
|
-
if (storage === 'cancel') return
|
|
292
|
-
context.apiKey = key; context.saveKey = storage === 'save'
|
|
286
|
+
context.apiKey = key; context.saveKey = true
|
|
293
287
|
break
|
|
294
288
|
}
|
|
295
289
|
}
|
|
@@ -367,14 +361,6 @@ export async function wizard({ dispatch, input = process.stdin, output = process
|
|
|
367
361
|
const colored = colorize(warning, 'warning', { output })
|
|
368
362
|
output.write(colored === warning ? warning : `\u001b[1m${colored}\u001b[0m`)
|
|
369
363
|
}
|
|
370
|
-
if ((action === 'setup' || action === 'reconfigure') && context.apiKey && !context.saveKey) {
|
|
371
|
-
output.write(t('This key is only available now. Paste it again when reopening coding-helper.\n', 'Khóa chỉ có trong lần chạy này. Dán lại khi mở coding-helper lần sau.\n'))
|
|
372
|
-
const launch = await choose(t('Start a new session?', 'Mở phiên mới?'), [
|
|
373
|
-
{ label: t('Finish', 'Hoàn tất'), value: false },
|
|
374
|
-
{ label: t('Start new session now (may incur charges)', 'Mở phiên mới ngay (có thể phát sinh phí)'), value: true }
|
|
375
|
-
])
|
|
376
|
-
if (launch) return dispatch(['run', '--tool', tool], { language, apiKey: context.apiKey, saveKey: false })
|
|
377
|
-
}
|
|
378
364
|
return result
|
|
379
365
|
} catch (error) {
|
|
380
366
|
if (error.code === 'UI_CANCELLED') {
|