@deepdynamic/cli 0.1.0 → 0.1.1

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 (58) hide show
  1. package/dist/agents/content.js +1 -1
  2. package/dist/agents/install.js +22 -12
  3. package/dist/agents/refresh.js +20 -0
  4. package/dist/agents/setup.js +7 -7
  5. package/dist/cli.js +8 -8
  6. package/dist/commands/account.js +19 -19
  7. package/dist/commands/activity.js +13 -13
  8. package/dist/commands/blocked.js +16 -16
  9. package/dist/commands/deploy/index.js +16 -16
  10. package/dist/commands/deploy/ship.js +8 -8
  11. package/dist/commands/deployments.js +8 -7
  12. package/dist/commands/dns.js +228 -242
  13. package/dist/commands/domains.js +188 -260
  14. package/dist/commands/emails.js +17 -17
  15. package/dist/commands/env.js +38 -38
  16. package/dist/commands/help.js +18 -19
  17. package/dist/commands/keys.js +83 -89
  18. package/dist/commands/login/flow.js +11 -11
  19. package/dist/commands/login/index.js +3 -3
  20. package/dist/commands/logout.js +11 -11
  21. package/dist/commands/mail.js +62 -62
  22. package/dist/commands/notifications.js +30 -29
  23. package/dist/commands/plan.js +109 -125
  24. package/dist/commands/projects.js +159 -157
  25. package/dist/commands/reference.js +109 -102
  26. package/dist/commands/search.js +29 -18
  27. package/dist/commands/server.js +99 -112
  28. package/dist/commands/sessions.js +38 -44
  29. package/dist/commands/sites.js +16 -16
  30. package/dist/commands/sms.js +14 -14
  31. package/dist/commands/status.js +9 -9
  32. package/dist/commands/support.js +19 -19
  33. package/dist/commands/update.js +18 -16
  34. package/dist/commands/usage.js +12 -12
  35. package/dist/commands/verify.js +16 -16
  36. package/dist/guide.js +9 -48
  37. package/dist/http/request.js +3 -3
  38. package/dist/pretty.js +4 -4
  39. package/dist/refresh-skills.js +5 -0
  40. package/dist/registry.js +72 -144
  41. package/dist/runtime/card-request.js +6 -6
  42. package/dist/runtime/confirm.js +1 -1
  43. package/dist/runtime/development.js +1 -1
  44. package/dist/runtime/dry-run.js +2 -2
  45. package/dist/runtime/env-file.js +6 -9
  46. package/dist/runtime/flags.js +11 -13
  47. package/dist/runtime/login-screen.js +5 -5
  48. package/dist/runtime/page.js +4 -4
  49. package/dist/runtime/server-options.js +4 -8
  50. package/dist/runtime/spinner.js +3 -1
  51. package/dist/runtime/support.js +2 -3
  52. package/dist/runtime/text-file.js +5 -5
  53. package/dist/runtime/timeout.js +2 -2
  54. package/dist/runtime/update-check.js +48 -14
  55. package/dist/runtime/update-install.js +34 -4
  56. package/dist/runtime/usage-error.js +2 -2
  57. package/dist/setup-agents.js +9 -2
  58. package/package.json +1 -1
@@ -4,84 +4,78 @@ import { agentResult } from "../output.js";
4
4
  import { prettyResult } from "../pretty.js";
5
5
  import { plannedChange, plannedRequest } from "../runtime/dry-run.js";
6
6
  import { unknownArgument } from "../runtime/flags.js";
7
- import { fail, rehearsed } from "./dns.js";
7
+ import { rehearsed } from "./dns.js";
8
8
  export const SESSIONS_PATH = '/api/v1/security/sessions';
9
9
  const SESSION_ID = /^(?:[0-9a-f]{64}|[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12})$/;
10
10
  const TOKEN_VALUE = /^dd(?:c_|_)/i;
11
- const KIND_LABELS = { web: '웹', cli: 'CLI' };
12
- const SESSION_NOT_FOUND = {
13
- code: 'session_not_found',
14
- message: 'No session with that ID is among your sessions. Check them with deepdynamic sessions.',
15
- display: '내 세션 목록에 없는 세션 ID 입니다.'
16
- };
17
- const CURRENT_SESSION = {
18
- code: 'current_session',
19
- message: 'That is the session this CLI is using. It cannot be revoked here; run deepdynamic logout to end it.',
20
- display: '지금 이 CLI 가 쓰는 세션입니다. 여기서는 회수할 수 없고 deepdynamic logout 으로 끝낼 수 있습니다.'
21
- };
22
- const LIST_STEPS = [{ stage: 'prepare_request', message: '세션 목록 요청을 준비하고 있습니다.' }];
11
+ const KIND_LABELS = { web: 'Browser', cli: 'CLI' };
12
+ const failure = (code, message) => ({ code, message, display: message });
13
+ const SESSION_NOT_FOUND = failure('session_not_found', 'No session with that ID is among your sessions. Check them with deepdynamic sessions.');
14
+ const CURRENT_SESSION = failure('current_session', 'That is the session this CLI is using. It cannot be revoked here; run deepdynamic logout to end it.');
15
+ const LIST_STEPS = [{ stage: 'prepare_request', message: 'Preparing the session list request.' }];
23
16
  const REVOKE_STEPS = [
24
- { stage: 'validate_id', message: '세션 ID 형식을 확인하고 있습니다.' },
25
- { stage: 'summarize_impact', message: '회수하면 끊기는 접근을 정리하고 있습니다.' },
26
- { stage: 'prepare_request', message: '회수 요청을 준비하고 있습니다.' }
17
+ { stage: 'validate_id', message: 'Checking the session ID format.' },
18
+ { stage: 'summarize_impact', message: 'Summarizing the access that revoking cuts off.' },
19
+ { stage: 'prepare_request', message: 'Preparing the revoke request.' }
27
20
  ];
28
21
  const sessionsUrl = (siteUrl, suffix = '') => new URL(`${SESSIONS_PATH}${suffix}`, siteUrl).href;
29
- const when = (iso) => (iso === null ? '없음' : iso.replace('T', ' ').replace(/\.\d{3}Z$/, ' UTC'));
30
- const describe = (session) => session.kind === 'web' ? `${session.device?.browser ?? 'Unknown'} · ${session.device?.os ?? 'Unknown'}` : (session.name ?? 'CLI 토큰');
22
+ const when = (iso) => (iso === null ? 'never' : iso.replace('T', ' ').replace(/\.\d{3}Z$/, ' UTC'));
23
+ const describe = (session) => session.kind === 'web' ? `${session.device?.browser ?? 'Unknown'} · ${session.device?.os ?? 'Unknown'}` : (session.name ?? 'CLI token');
24
+ const count = (amount, noun) => `${amount} ${noun}${amount === 1 ? '' : 's'}`;
31
25
  function sessionLine(session) {
32
26
  const parts = [
33
- ...(session.current ? ['현재'] : []),
27
+ ...(session.current ? ['Current'] : []),
34
28
  KIND_LABELS[session.kind],
35
29
  describe(session),
36
- `IP ${session.ip ?? '알 수 없음'}`,
37
- ...(session.lastIp && session.lastIp !== session.ip ? [`마지막 IP ${session.lastIp}`] : []),
38
- `마지막 활동 ${when(session.lastSeen)}`
30
+ `IP ${session.ip ?? 'unknown'}`,
31
+ ...(session.lastIp && session.lastIp !== session.ip ? [`Last IP ${session.lastIp}`] : []),
32
+ `Last active ${when(session.lastSeen)}`
39
33
  ];
40
34
  return [session.id, parts.join(' · ')];
41
35
  }
42
36
  function sessionRows(session) {
43
37
  return [
44
- ['세션 ID', session.id],
45
- ['종류', `${KIND_LABELS[session.kind]} · ${describe(session)}`],
46
- ['IP', session.ip ?? '알 수 없음'],
47
- ...(session.lastIp ? [['마지막 IP', session.lastIp]] : []),
48
- ['마지막 활동', when(session.lastSeen)],
49
- ['로그인', when(session.createdAt)],
50
- ['만료', when(session.expiresAt)]
38
+ ['Session ID', session.id],
39
+ ['Type', `${KIND_LABELS[session.kind]} · ${describe(session)}`],
40
+ ['IP', session.ip ?? 'unknown'],
41
+ ...(session.lastIp ? [['Last IP', session.lastIp]] : []),
42
+ ['Last active', when(session.lastSeen)],
43
+ ['Signed in', when(session.createdAt)],
44
+ ['Expires', when(session.expiresAt)]
51
45
  ];
52
46
  }
53
- function parseRevoke(args, pretty) {
47
+ function parseRevoke(args) {
54
48
  const option = args.find((arg) => arg.startsWith('-'));
55
49
  if (option)
56
- return { error: unknownArgument(option, pretty) };
50
+ return { error: unknownArgument(option) };
57
51
  if (args.length !== 1)
58
- return fail(pretty, 'Specify exactly one session ID.', '회수할 세션 ID 를 하나만 지정하세요.');
52
+ return { error: 'Specify exactly one session ID.' };
59
53
  if (TOKEN_VALUE.test(args[0]))
60
- return fail(pretty, 'Pass the session ID listed by deepdynamic sessions, not a token value.', '토큰 값이 아니라 deepdynamic sessions 에 나오는 세션 ID 를 지정하세요.');
54
+ return { error: 'Pass the session ID listed by deepdynamic sessions, not a token value.' };
61
55
  const id = args[0].toLowerCase();
62
56
  if (!SESSION_ID.test(id))
63
- return fail(pretty, 'Session IDs are the id values listed by deepdynamic sessions.', '세션 ID 는 deepdynamic sessions 에 나오는 id 값입니다.');
57
+ return { error: 'Session IDs are the id values listed by deepdynamic sessions.' };
64
58
  return id;
65
59
  }
66
60
  export async function runSessionsList(args, pretty, depth, deps = defaultAuthDeps(pretty, depth)) {
67
61
  const command = 'sessions';
68
62
  return rehearsed(command, args, pretty, depth, deps, (rest) => {
69
63
  if (rest.length)
70
- return { error: unknownArgument(rest[0], pretty) };
64
+ return { error: unknownArgument(rest[0]) };
71
65
  return {
72
66
  steps: LIST_STEPS,
73
67
  result: (siteUrl) => plannedRequest(command, pretty, depth, siteUrl, sessionsUrl(siteUrl)),
74
68
  send: {
75
69
  method: 'GET',
76
70
  url: (siteUrl) => sessionsUrl(siteUrl),
77
- spinner: '로그인 세션을 불러오고 있습니다.',
78
- failed: '로그인 세션을 불러오지 못했습니다.',
71
+ spinner: 'Loading login sessions.',
72
+ failed: 'Could not load login sessions.',
79
73
  notFound: httpFailure(404),
80
74
  done: (body, siteUrl) => {
81
75
  const { sessions } = body;
82
76
  if (!pretty)
83
77
  return agentResult(0, { command, siteUrl, sessions });
84
- return prettyResult(0, depth, command, `활성 세션 ${sessions.length}개를 불러왔습니다.`, [['서버', siteUrl], ...sessions.map(sessionLine)]);
78
+ return prettyResult(0, depth, command, `Loaded ${count(sessions.length, 'active session')}.`, [['Server', siteUrl], ...sessions.map(sessionLine)]);
85
79
  }
86
80
  }
87
81
  };
@@ -90,31 +84,31 @@ export async function runSessionsList(args, pretty, depth, deps = defaultAuthDep
90
84
  export async function runSessionsRevoke(args, pretty, depth, deps = defaultAuthDeps(pretty, depth)) {
91
85
  const command = 'sessions revoke';
92
86
  return rehearsed(command, args, pretty, depth, deps, (rest) => {
93
- const id = parseRevoke(rest, pretty);
87
+ const id = parseRevoke(rest);
94
88
  if (typeof id !== 'string')
95
89
  return id;
96
90
  const path = `/${encodeURIComponent(id)}/revoke`;
97
91
  return {
98
92
  steps: REVOKE_STEPS,
99
- result: (siteUrl) => plannedChange(command, pretty, depth, siteUrl, { url: sessionsUrl(siteUrl, path), body: {} }, '세션 회수 요청을 확인했습니다. 회수하지 않았습니다.', [['세션 ID', id], ['영향', '회수하면 그 세션으로 로그인한 브라우저나 터미널은 바로 로그아웃됩니다.']], { sessionId: id }),
93
+ result: (siteUrl) => plannedChange(command, pretty, depth, siteUrl, { url: sessionsUrl(siteUrl, path), body: {} }, 'Checked the session revoke request. The session was not revoked.', [['Session ID', id], ['Impact', 'Revoking signs out the browser or terminal that uses this session at once.']], { sessionId: id }),
100
94
  send: {
101
95
  method: 'POST',
102
96
  url: (siteUrl) => sessionsUrl(siteUrl, path),
103
97
  body: {},
104
- spinner: '세션을 회수하고 있습니다.',
105
- failed: '세션을 회수하지 못했습니다.',
98
+ spinner: 'Revoking the session.',
99
+ failed: 'Could not revoke the session.',
106
100
  notFound: SESSION_NOT_FOUND,
107
101
  failures: { current_session: CURRENT_SESSION },
108
102
  done: (body, siteUrl) => {
109
103
  const { session } = body;
110
104
  return pretty
111
- ? prettyResult(0, depth, command, `${KIND_LABELS[session.kind]} 세션을 회수했습니다.`, [['서버', siteUrl], ...sessionRows(session), ['영향', '그 세션으로 로그인한 브라우저나 터미널은 바로 로그아웃됩니다.']])
105
+ ? prettyResult(0, depth, command, `Revoked the ${session.kind === 'web' ? 'browser' : 'CLI'} session.`, [['Server', siteUrl], ...sessionRows(session), ['Impact', 'The browser or terminal that used this session is now signed out.']])
112
106
  : agentResult(0, { command, siteUrl, applied: true, sessionId: session.id, session });
113
107
  }
114
108
  }
115
109
  };
116
110
  }, {
117
111
  message: 'Revoking signs out the browser or terminal that uses the session at once.',
118
- display: '회수하면 그 세션으로 로그인한 브라우저나 터미널이 바로 로그아웃됩니다. 사용자에게 확인한 뒤 --yes 를 붙여 실행하세요.'
112
+ display: 'Revoking signs out the browser or terminal that uses the session at once. Confirm with the user, then run it with --yes.'
119
113
  });
120
114
  }
@@ -8,7 +8,7 @@ import { spec } from "../registry.js";
8
8
  import { plannedRequest, splitDryRun } from "../runtime/dry-run.js";
9
9
  import { SERVER_OPTION, parseServerArgs } from "../runtime/server-options.js";
10
10
  export const SITES_PATH = '/api/v1/sites';
11
- const { name: command, usage, prettyUsage } = spec('sites');
11
+ const { name: command, usage } = spec('sites');
12
12
  const FLAGS = ['--page', SERVER_OPTION];
13
13
  const PAGE_RE = /^[1-9]\d{0,5}$/;
14
14
  function isSite(value) {
@@ -32,8 +32,8 @@ function isListing(body) {
32
32
  && Array.isArray(listing.sites)
33
33
  && listing.sites.every(isSite);
34
34
  }
35
- function parseSitesArgs(args, pretty) {
36
- const parsed = parseFlags(args, FLAGS, pretty);
35
+ function parseSitesArgs(args) {
36
+ const parsed = parseFlags(args, FLAGS);
37
37
  if ('error' in parsed)
38
38
  return parsed;
39
39
  let page = 1;
@@ -46,10 +46,10 @@ function parseSitesArgs(args, pretty) {
46
46
  page = Number(value);
47
47
  }
48
48
  else {
49
- return { error: pretty ? `--page 에는 1 이상의 정수를 지정하세요: ${value}` : `--page requires a positive integer: ${value}` };
49
+ return { error: `--page requires a positive integer: ${value}` };
50
50
  }
51
51
  }
52
- const server = parseServerArgs(serverArgs, pretty);
52
+ const server = parseServerArgs(serverArgs);
53
53
  return 'error' in server ? server : { page, siteUrl: server.siteUrl };
54
54
  }
55
55
  const plain = (text) => text.replace(CONTROL, ' ');
@@ -57,15 +57,15 @@ function rows({ name, tagline, url, regions, monthlyVisits, createdAt }) {
57
57
  return [
58
58
  [plain(name), plain(url)],
59
59
  ...(tagline ? [['', plain(tagline)]] : []),
60
- ['', plain(`${regions} · 월 방문 ${monthlyVisits.toLocaleString('ko-KR')}명 · ${createdAt.slice(0, 10)} 공개`)]
60
+ ['', plain(`${regions} · ${monthlyVisits.toLocaleString('en-US')} visits/month · published ${createdAt.slice(0, 10)}`)]
61
61
  ];
62
62
  }
63
63
  export async function runSites(args, pretty, depth, deps = defaultDeps()) {
64
64
  const { args: rest, dryRun } = splitDryRun(args);
65
- const options = parseSitesArgs(rest, pretty);
65
+ const options = parseSitesArgs(rest);
66
66
  if ('error' in options) {
67
67
  return pretty
68
- ? prettyResult(2, depth, command, options.error, [['사용법', prettyUsage]])
68
+ ? prettyResult(2, depth, command, options.error, [['Usage', usage]])
69
69
  : agentResult(2, { command, error: { code: 'invalid_arguments', message: options.error }, usage });
70
70
  }
71
71
  const siteUrl = options.siteUrl ?? await readLoginSiteUrl() ?? SITE_URL;
@@ -73,7 +73,7 @@ export async function runSites(args, pretty, depth, deps = defaultDeps()) {
73
73
  endpoint.searchParams.set('page', String(options.page));
74
74
  if (dryRun)
75
75
  return plannedRequest(command, pretty, depth, siteUrl, endpoint.href);
76
- const result = await request(endpoint.href, { method: 'GET' }, deps, pretty ? '공개 사이트를 불러오고 있습니다.' : null);
76
+ const result = await request(endpoint.href, { method: 'GET' }, deps, pretty ? 'Loading public sites.' : null);
77
77
  if ('failure' in result || result.status !== 200 || !isListing(result.body)) {
78
78
  const failure = 'failure' in result
79
79
  ? result.failure
@@ -81,7 +81,7 @@ export async function runSites(args, pretty, depth, deps = defaultDeps()) {
81
81
  ? httpFailure(result.status)
82
82
  : UNEXPECTED;
83
83
  return pretty
84
- ? prettyResult(1, depth, command, '공개 사이트를 불러오지 못했습니다.', [['서버', siteUrl], ['원인', failure.display]])
84
+ ? prettyResult(1, depth, command, 'Could not load public sites.', [['Server', siteUrl], ['Reason', failure.display]])
85
85
  : agentResult(1, { command, siteUrl, error: failureError(failure) });
86
86
  }
87
87
  const { total, page, pageSize, totalPages, sites } = result.body;
@@ -90,13 +90,13 @@ export async function runSites(args, pretty, depth, deps = defaultDeps()) {
90
90
  return agentResult(0, { command, siteUrl, total, page, pageSize, totalPages, next, sites });
91
91
  }
92
92
  return prettyResult(0, depth, command, total === 0
93
- ? '아직 공개된 사이트가 없습니다.'
93
+ ? 'No sites have been published yet.'
94
94
  : sites.length
95
- ? `공개 사이트 ${total}개 중 ${sites.length}개를 불러왔습니다.`
96
- : `${page}페이지에는 사이트가 없습니다.`, [
97
- ['서버', siteUrl],
95
+ ? `Loaded ${sites.length} of ${total} public site${total === 1 ? '' : 's'}.`
96
+ : `Page ${page} has no sites.`, [
97
+ ['Server', siteUrl],
98
98
  ...sites.flatMap(rows),
99
- ['페이지', `${page} / ${totalPages}`],
100
- ...(next ? [['다음', next]] : [])
99
+ ['Page', `${page} / ${totalPages}`],
100
+ ...(next ? [['Next', next]] : [])
101
101
  ]);
102
102
  }
@@ -7,29 +7,29 @@ import { splitDryRun } from "../runtime/dry-run.js";
7
7
  import { parseFlags } from "../runtime/flags.js";
8
8
  import { readText } from "../runtime/text-file.js";
9
9
  export const SMS_PATH = '/api/v1/sms';
10
- const { name: command, usage, prettyUsage } = spec('sms send');
10
+ const { name: command, usage } = spec('sms send');
11
11
  const FLAGS = ['--to', '--body', '--body-file'];
12
- async function parseSendArgs(args, pretty) {
13
- const parsed = parseFlags(args, FLAGS, pretty);
12
+ async function parseSendArgs(args) {
13
+ const parsed = parseFlags(args, FLAGS);
14
14
  if ('error' in parsed)
15
15
  return parsed;
16
16
  const values = Object.fromEntries(parsed.entries);
17
17
  const { '--to': to, '--body': body, '--body-file': bodyFile } = values;
18
18
  if (to === undefined) {
19
- return { error: pretty ? '--to 를 지정하세요.' : '--to is required.' };
19
+ return { error: '--to is required.' };
20
20
  }
21
- const content = await readText('--body', body, bodyFile, pretty);
21
+ const content = await readText('--body', body, bodyFile);
22
22
  return 'error' in content ? content : { to, body: content.text };
23
23
  }
24
24
  export async function runSmsSend(args, pretty, depth, deps = defaultAuthDeps(pretty, depth)) {
25
25
  const { args: rest, dryRun } = splitDryRun(args);
26
- const parsed = await parseSendArgs(rest, pretty);
26
+ const parsed = await parseSendArgs(rest);
27
27
  if ('error' in parsed) {
28
28
  return pretty
29
- ? prettyResult(2, depth, command, parsed.error, [['사용법', prettyUsage]])
29
+ ? prettyResult(2, depth, command, parsed.error, [['Usage', usage]])
30
30
  : agentResult(2, { command, error: { code: 'invalid_arguments', message: parsed.error }, usage });
31
31
  }
32
- const sent = await authorized(deps, ({ siteUrl, token }) => postJson(new URL(SMS_PATH, siteUrl).href, token, dryRun ? { ...parsed, dryRun } : parsed, deps, pretty ? (dryRun ? '문자를 검증하고 있습니다.' : '문자를 보내고 있습니다.') : null));
32
+ const sent = await authorized(deps, ({ siteUrl, token }) => postJson(new URL(SMS_PATH, siteUrl).href, token, dryRun ? { ...parsed, dryRun } : parsed, deps, pretty ? (dryRun ? 'Validating the SMS.' : 'Sending the SMS.') : null));
33
33
  if ('login' in sent)
34
34
  return sent.login;
35
35
  const { session: { siteUrl }, result } = sent;
@@ -44,22 +44,22 @@ export async function runSmsSend(args, pretty, depth, deps = defaultAuthDeps(pre
44
44
  else if (!accepted(result)) {
45
45
  rejected = result.status === 400 && result.body?.rejected === true;
46
46
  failure = rejected
47
- ? { code: 'spam_rejected', message: 'The server rejected the message as advertising or spam. The account may be blocked if this continues.', display: '광고·스팸으로 보이는 내용이라 거절되었습니다.' }
47
+ ? { code: 'spam_rejected', message: 'The server rejected the message as advertising or spam. The account may be blocked if this continues.', display: 'The server rejected the message as advertising or spam. The account may be blocked if this continues.' }
48
48
  : result.status === 400
49
- ? { code: 'rejected', message: 'The server rejected the message. Check the recipient and body.', display: '받는 사람·본문을 확인하세요.' }
49
+ ? { code: 'rejected', message: 'The server rejected the message. Check the recipient and body.', display: 'The server rejected the message. Check the recipient and body.' }
50
50
  : httpFailure(result.status);
51
51
  }
52
52
  if (failure) {
53
53
  return pretty
54
- ? prettyResult(1, depth, command, rejected ? '문자가 거절되었습니다.' : dryRun ? '문자를 검증하지 못했습니다.' : '문자를 보내지 못했습니다.', [['서버', siteUrl], ['원인', failure.display]])
54
+ ? prettyResult(1, depth, command, rejected ? 'The SMS was rejected.' : dryRun ? 'Could not validate the SMS.' : 'Could not send the SMS.', [['Server', siteUrl], ['Reason', failure.display]])
55
55
  : agentResult(1, { command, siteUrl, delivered: false, ...(rejected ? { rejected } : {}), error: sendFailureError(result, failure) });
56
56
  }
57
57
  const { dryRun: checked, delivered, id, to } = result.body;
58
58
  if (!pretty) {
59
59
  return agentResult(0, { command, siteUrl, ...(checked === true ? { dryRun: true } : {}), delivered, rejected, id, to });
60
60
  }
61
- return prettyResult(0, depth, command, checked === true ? '문자를 검증했습니다. 보내지 않았습니다.' : '문자를 보냈습니다.', [
62
- ['서버', siteUrl],
63
- ['받는 사람', to]
61
+ return prettyResult(0, depth, command, checked === true ? 'Validated the SMS. Nothing was sent.' : 'Sent the SMS.', [
62
+ ['Server', siteUrl],
63
+ ['To', to]
64
64
  ]);
65
65
  }
@@ -9,7 +9,7 @@ import { plannedRequest, splitDryRun } from "../runtime/dry-run.js";
9
9
  import { parseServerArgs } from "../runtime/server-options.js";
10
10
  import { startSpinner } from "../runtime/spinner.js";
11
11
  import { supportFailure } from "../runtime/support.js";
12
- const { name: command, usage, prettyUsage } = spec('system status');
12
+ const { name: command, usage } = spec('system status');
13
13
  const BACKEND_UNAVAILABLE = supportFailure('backend_unavailable');
14
14
  async function checkBackend(siteUrl, signal, fetcher) {
15
15
  try {
@@ -23,10 +23,10 @@ async function checkBackend(siteUrl, signal, fetcher) {
23
23
  }
24
24
  export async function runStatus(args, pretty, depth, deps = { fetch, stream: process.stderr, timeoutMs: 10_000 }) {
25
25
  const { args: rest, dryRun } = splitDryRun(args);
26
- const options = parseServerArgs(rest, pretty);
26
+ const options = parseServerArgs(rest);
27
27
  if ('error' in options) {
28
28
  return pretty
29
- ? prettyResult(2, depth, command, options.error, [['사용법', prettyUsage]])
29
+ ? prettyResult(2, depth, command, options.error, [['Usage', usage]])
30
30
  : agentResult(2, {
31
31
  command,
32
32
  error: { code: 'invalid_arguments', message: options.error },
@@ -36,7 +36,7 @@ export async function runStatus(args, pretty, depth, deps = { fetch, stream: pro
36
36
  const siteUrl = options.siteUrl ?? await readLoginSiteUrl() ?? SITE_URL;
37
37
  if (dryRun)
38
38
  return plannedRequest(command, pretty, depth, siteUrl, new URL('/api/v1/status', siteUrl).href);
39
- const stop = pretty ? startSpinner('배포 서버에 연결하고 있습니다.', deps.stream) : () => { };
39
+ const stop = pretty ? startSpinner('Connecting to the deployment server.', deps.stream) : () => { };
40
40
  const controller = new AbortController();
41
41
  const timer = setTimeout(() => controller.abort(), deps.timeoutMs);
42
42
  let httpStatus = null;
@@ -64,8 +64,8 @@ export async function runStatus(args, pretty, depth, deps = { fetch, stream: pro
64
64
  }
65
65
  catch {
66
66
  failure = controller.signal.aborted
67
- ? { code: 'connection_timeout', message: 'The connection timed out.', display: '서버 응답 대기 시간이 초과되었습니다.' }
68
- : { code: 'connection_failed', message: 'Could not connect to the deployment server.', display: '서버 주소와 네트워크 연결을 확인하세요.' };
67
+ ? { code: 'connection_timeout', message: 'The connection timed out.', display: 'The server did not respond in time.' }
68
+ : { code: 'connection_failed', message: 'Could not connect to the deployment server.', display: 'Check the server URL and your network connection.' };
69
69
  }
70
70
  finally {
71
71
  clearTimeout(timer);
@@ -81,7 +81,7 @@ export async function runStatus(args, pretty, depth, deps = { fetch, stream: pro
81
81
  });
82
82
  }
83
83
  if (!failure)
84
- return prettyResult(0, depth, command, '배포 서버에 연결 성공했습니다.', [['서버', siteUrl], ['서비스', '정상']]);
85
- const target = backend === 'unavailable' ? '서비스' : '배포 서버';
86
- return prettyResult(1, depth, command, `${target}에 연결 실패했습니다.`, [['서버', siteUrl], ['원인', failure.display]]);
84
+ return prettyResult(0, depth, command, 'Connected to the deployment server.', [['Server', siteUrl], ['Services', 'OK']]);
85
+ const target = backend === 'unavailable' ? 'the services' : 'the deployment server';
86
+ return prettyResult(1, depth, command, `Could not connect to ${target}.`, [['Server', siteUrl], ['Reason', failure.display]]);
87
87
  }
@@ -19,16 +19,16 @@ function isGuide(body) {
19
19
  export async function runQa(args, pretty, depth, deps = defaultDeps()) {
20
20
  const command = QA.name;
21
21
  const { args: rest, dryRun } = splitDryRun(args);
22
- const options = parseServerArgs(rest, pretty);
22
+ const options = parseServerArgs(rest);
23
23
  if ('error' in options) {
24
24
  return pretty
25
- ? prettyResult(2, depth, command, options.error, [['사용법', QA.prettyUsage]])
25
+ ? prettyResult(2, depth, command, options.error, [['Usage', QA.usage]])
26
26
  : agentResult(2, { command, error: { code: 'invalid_arguments', message: options.error }, usage: QA.usage });
27
27
  }
28
28
  const siteUrl = options.siteUrl ?? await readLoginSiteUrl() ?? SITE_URL;
29
29
  if (dryRun)
30
30
  return plannedRequest(command, pretty, depth, siteUrl, new URL(CONTACT_PATH, siteUrl).href);
31
- const result = await request(new URL(CONTACT_PATH, siteUrl).href, { method: 'GET' }, deps, pretty ? '자주 묻는 질문을 불러오고 있습니다.' : null);
31
+ const result = await request(new URL(CONTACT_PATH, siteUrl).href, { method: 'GET' }, deps, pretty ? 'Loading the FAQ.' : null);
32
32
  if ('failure' in result || result.status !== 200 || !isGuide(result.body)) {
33
33
  const failure = 'failure' in result
34
34
  ? result.failure
@@ -36,23 +36,23 @@ export async function runQa(args, pretty, depth, deps = defaultDeps()) {
36
36
  ? httpFailure(result.status)
37
37
  : UNEXPECTED;
38
38
  return pretty
39
- ? prettyResult(1, depth, command, '자주 묻는 질문을 불러오지 못했습니다.', [['서버', siteUrl], ['원인', failure.display]])
39
+ ? prettyResult(1, depth, command, 'Could not load the FAQ.', [['Server', siteUrl], ['Reason', failure.display]])
40
40
  : agentResult(1, { command, siteUrl, error: failureError(failure) });
41
41
  }
42
42
  const guide = result.body;
43
43
  if (!pretty) {
44
44
  return agentResult(0, { command, siteUrl, ...guide, send: CONTACT.usage });
45
45
  }
46
- return prettyResult(0, depth, command, '자주 묻는 질문을 불러왔습니다.', [
46
+ return prettyResult(0, depth, command, 'Loaded the FAQ.', [
47
47
  ...guide.faq.flatMap(({ question, answer }, index) => [
48
- [`Q${index + 1}`, question.ko],
49
- ['', answer.ko]
48
+ [`Q${index + 1}`, question.en],
49
+ ['', answer.en]
50
50
  ]),
51
- ['문의', 'deepdynamic support contact --message <내용>']
51
+ ['Contact', 'deepdynamic support contact --message <text>']
52
52
  ]);
53
53
  }
54
- async function parseContactArgs(args, pretty) {
55
- const parsed = parseFlags(args, CONTACT_FLAGS, pretty);
54
+ async function parseContactArgs(args) {
55
+ const parsed = parseFlags(args, CONTACT_FLAGS);
56
56
  if ('error' in parsed)
57
57
  return parsed;
58
58
  let message;
@@ -66,19 +66,19 @@ async function parseContactArgs(args, pretty) {
66
66
  else
67
67
  teamEmails.push(value);
68
68
  }
69
- const content = await readText('--message', message, messageFile, pretty);
69
+ const content = await readText('--message', message, messageFile);
70
70
  return 'error' in content ? content : { message: content.text, teamEmails };
71
71
  }
72
72
  export async function runContact(args, pretty, depth, deps = defaultAuthDeps(pretty, depth)) {
73
73
  const command = CONTACT.name;
74
74
  const { args: rest, dryRun } = splitDryRun(args);
75
- const parsed = await parseContactArgs(rest, pretty);
75
+ const parsed = await parseContactArgs(rest);
76
76
  if ('error' in parsed) {
77
77
  return pretty
78
- ? prettyResult(2, depth, command, parsed.error, [['사용법', CONTACT.prettyUsage]])
78
+ ? prettyResult(2, depth, command, parsed.error, [['Usage', CONTACT.usage]])
79
79
  : agentResult(2, { command, error: { code: 'invalid_arguments', message: parsed.error }, usage: CONTACT.usage });
80
80
  }
81
- const sent = await authorized(deps, ({ siteUrl, token }) => postJson(new URL(CONTACT_PATH, siteUrl).href, token, { message: parsed.message, ...(parsed.teamEmails.length ? { teamEmails: parsed.teamEmails } : {}), ...(dryRun ? { dryRun } : {}) }, deps, pretty ? (dryRun ? '문의 내용을 검증하고 있습니다.' : '문의를 보내고 있습니다.') : null));
81
+ const sent = await authorized(deps, ({ siteUrl, token }) => postJson(new URL(CONTACT_PATH, siteUrl).href, token, { message: parsed.message, ...(parsed.teamEmails.length ? { teamEmails: parsed.teamEmails } : {}), ...(dryRun ? { dryRun } : {}) }, deps, pretty ? (dryRun ? 'Validating the inquiry.' : 'Sending the inquiry.') : null));
82
82
  if ('login' in sent)
83
83
  return sent.login;
84
84
  const { session: { siteUrl }, result } = sent;
@@ -91,25 +91,25 @@ export async function runContact(args, pretty, depth, deps = defaultAuthDeps(pre
91
91
  }
92
92
  else if (!accepted(result)) {
93
93
  failure = result.status === 429
94
- ? { code: 'rate_limited', message: 'Too many inquiries. Try again later.', display: '요청이 너무 많습니다.' }
94
+ ? { code: 'rate_limited', message: 'Too many inquiries. Try again later.', display: 'Too many inquiries. Try again later.' }
95
95
  : result.status === 400
96
- ? { code: 'rejected', message: 'The server rejected the inquiry. Check the message and team emails.', display: '문의 내용을 확인하세요.' }
96
+ ? { code: 'rejected', message: 'The server rejected the inquiry. Check the message and team emails.', display: 'The server rejected the inquiry. Check the message and team emails.' }
97
97
  : httpFailure(result.status);
98
98
  }
99
99
  if (failure) {
100
100
  return pretty
101
- ? prettyResult(1, depth, command, dryRun ? '문의 내용을 검증하지 못했습니다.' : '문의를 보내지 못했습니다.', [['서버', siteUrl], ['원인', failure.display]])
101
+ ? prettyResult(1, depth, command, dryRun ? 'Could not validate the inquiry.' : 'Could not send the inquiry.', [['Server', siteUrl], ['Reason', failure.display]])
102
102
  : agentResult(1, { command, siteUrl, error: sendFailureError(result, failure) });
103
103
  }
104
104
  const { id, dryRun: checked } = result.body;
105
105
  const email = await readAccountEmail();
106
106
  if (checked === true) {
107
107
  return pretty
108
- ? prettyResult(0, depth, command, '문의 내용을 검증했습니다. 보내지 않았습니다.', [['서버', siteUrl]])
108
+ ? prettyResult(0, depth, command, 'Validated the inquiry. Nothing was sent.', [['Server', siteUrl]])
109
109
  : agentResult(0, { command, siteUrl, dryRun: true, replyTo: email });
110
110
  }
111
111
  if (!pretty) {
112
112
  return agentResult(0, { command, siteUrl, id: typeof id === 'string' ? id : null, replyTo: email });
113
113
  }
114
- return prettyResult(0, depth, command, '문의를 보냈습니다. 답변은 계정 이메일로 받습니다.', [['서버', siteUrl], ['답변 메일', email ?? '로그인 계정']]);
114
+ return prettyResult(0, depth, command, 'Sent the inquiry. Replies go to the account email.', [['Server', siteUrl], ['Reply to', email ?? 'The logged-in account']]);
115
115
  }
@@ -5,7 +5,7 @@ import { confirmationRequired, splitYes } from "../runtime/confirm.js";
5
5
  import { splitDryRun } from "../runtime/dry-run.js";
6
6
  import { unknownArgument } from "../runtime/flags.js";
7
7
  import { startSpinner } from "../runtime/spinner.js";
8
- import { REGISTRY_URL, isNewer, latestOf, saveUpdateCache, updateCachePath, updateLockPath, withUpdateLock } from "../runtime/update-check.js";
8
+ import { REGISTRY_URL, isNewer, latestOf, saveUpdateCache, startSkillRefresh, updateCachePath, updateLockPath, withUpdateLock } from "../runtime/update-check.js";
9
9
  import { PACKAGE_DIR, findPackageManager, installArgs, packageManagerOf, runProgram } from "../runtime/update-install.js";
10
10
  import { usageError } from "../runtime/usage-error.js";
11
11
  const command = 'update';
@@ -15,23 +15,24 @@ export const defaultUpdateCommandDeps = () => ({
15
15
  now: Date.now,
16
16
  packageManager: packageManagerOf(PACKAGE_DIR),
17
17
  find: findPackageManager,
18
- install: runProgram
18
+ install: runProgram,
19
+ refreshSkills: startSkillRefresh
19
20
  });
20
21
  const registryFailure = (status) => ({
21
22
  code: 'http_error',
22
23
  message: 'The npm registry answered with an error.',
23
- display: 'npm 레지스트리가 오류로 응답했습니다. 잠시 뒤 다시 시도하세요.',
24
+ display: 'The npm registry returned an error. Try again later.',
24
25
  retryable: status >= 500 || status === 429
25
26
  });
26
27
  const REGISTRY_UNEXPECTED = {
27
28
  code: 'unexpected_response',
28
29
  message: 'The npm registry did not return the latest version.',
29
- display: 'npm 레지스트리에서 최신 버전을 읽지 못했습니다.'
30
+ display: 'The npm registry did not return the latest version.'
30
31
  };
31
32
  const UPDATE_IN_PROGRESS = {
32
33
  code: 'update_in_progress',
33
34
  message: 'An automatic update is running in the background. Retry in a minute.',
34
- display: '백그라운드에서 자동 업데이트가 진행 중입니다. 잠시 뒤 다시 실행하세요.',
35
+ display: 'An automatic update is running in the background. Retry in a minute.',
35
36
  retryable: true
36
37
  };
37
38
  function failed(failure, pretty, depth, data, rows = [], detail) {
@@ -43,33 +44,33 @@ export async function runUpdate(args, current, pretty, depth, deps = defaultUpda
43
44
  const { args: withoutYes, yes } = splitYes(args);
44
45
  const { args: rest, dryRun } = splitDryRun(withoutYes);
45
46
  if (rest.length)
46
- return usageError(command, unknownArgument(rest[0], pretty), pretty, depth);
47
+ return usageError(command, unknownArgument(rest[0]), pretty, depth);
47
48
  const manager = deps.packageManager;
48
49
  if (dryRun) {
49
50
  return pretty
50
- ? prettyResult(0, depth, command, '요청을 보내거나 설치하지 않고 확인만 했습니다.', [['현재', current], ['요청', `GET ${REGISTRY_URL}`], ['설치', `${manager} ${installArgs(manager, '<최신 버전>').join(' ')}`]])
51
+ ? prettyResult(0, depth, command, 'Checked without sending the request or installing.', [['Current', current], ['Request', `GET ${REGISTRY_URL}`], ['Install', `${manager} ${installArgs(manager, '<latest-version>').join(' ')}`]])
51
52
  : agentResult(0, { command, current, packageManager: manager, dryRun: true, request: { method: 'GET', url: REGISTRY_URL } });
52
53
  }
53
- const response = await request(REGISTRY_URL, { method: 'GET' }, deps, pretty ? '최신 버전을 확인하고 있습니다.' : null);
54
+ const response = await request(REGISTRY_URL, { method: 'GET' }, deps, pretty ? 'Checking for the latest version.' : null);
54
55
  const latest = 'failure' in response || response.status !== 200 ? null : latestOf(response.body);
55
56
  if (!latest) {
56
57
  const failure = 'failure' in response ? response.failure : response.status !== 200 ? registryFailure(response.status) : REGISTRY_UNEXPECTED;
57
- return failed(failure, pretty, depth, { current }, [['현재', current]]);
58
+ return failed(failure, pretty, depth, { current }, [['Current', current]]);
58
59
  }
59
60
  await saveUpdateCache(deps.cachePath, { checkedAt: deps.now(), latest }).catch(() => { });
60
61
  if (!isNewer(latest, current)) {
61
62
  return pretty
62
- ? prettyResult(0, depth, command, '최신 버전을 쓰고 있습니다.', [['현재', current], ['최신', latest]])
63
+ ? prettyResult(0, depth, command, 'Already on the latest version.', [['Current', current], ['Latest', latest]])
63
64
  : agentResult(0, { command, current, latest, packageManager: manager, updated: false });
64
65
  }
65
66
  const argv = installArgs(manager, latest);
66
67
  const install = `${manager} ${argv.join(' ')}`;
67
68
  const data = { current, latest, packageManager: manager, install };
68
- const rows = [['현재', current], ['최신', latest], ['설치', install]];
69
+ const rows = [['Current', current], ['Latest', latest], ['Install', install]];
69
70
  if (!yes) {
70
71
  return confirmationRequired(command, args, pretty, depth, {
71
72
  message: `DeepDynamic CLI ${latest} is available (current ${current}). The update runs: ${install}.`,
72
- display: `새 버전이 나왔습니다(현재 ${current}, 최신 ${latest}). ${install} 을 실행합니다.`
73
+ display: `A new version is available (current ${current}, latest ${latest}). Updating runs ${install}.`
73
74
  }, data);
74
75
  }
75
76
  const path = await deps.find(manager);
@@ -77,10 +78,10 @@ export async function runUpdate(args, current, pretty, depth, deps = defaultUpda
77
78
  return failed({
78
79
  code: 'package_manager_not_found',
79
80
  message: `${manager} was not found on PATH. Update the CLI with the package manager that installed it, for example: ${install}`,
80
- display: `PATH 에서 ${manager} 을 찾지 못했습니다. CLI 를 설치한 패키지 관리자로 업데이트하세요.`
81
+ display: `${manager} was not found on PATH. Update the CLI with the package manager that installed it.`
81
82
  }, pretty, depth, data, rows);
82
83
  }
83
- const stop = pretty ? startSpinner(`최신 버전(${latest})을 설치하고 있습니다.`, deps.stream) : () => { };
84
+ const stop = pretty ? startSpinner(`Installing the latest version (${latest}).`, deps.stream) : () => { };
84
85
  const installed = await withUpdateLock(updateLockPath(deps.cachePath), () => deps.install(path, argv), deps.now);
85
86
  stop();
86
87
  if (!installed)
@@ -89,10 +90,11 @@ export async function runUpdate(args, current, pretty, depth, deps = defaultUpda
89
90
  return failed({
90
91
  code: 'update_failed',
91
92
  message: `${install} failed. Read error.detail, fix the cause (for example permissions of the global folder) or run the command yourself.`,
92
- display: `${manager} 설치가 실패했습니다. 아래 출력을 확인하거나 설치 명령을 직접 실행하세요.`
93
+ display: `${manager} failed to install the update. Check the output below or run the install command yourself.`
93
94
  }, pretty, depth, data, [...rows, [manager, installed.output]], installed.output);
94
95
  }
96
+ deps.refreshSkills();
95
97
  return pretty
96
- ? prettyResult(0, depth, command, `업데이트했습니다(${current} → ${latest}).`, [['이전', current], ['현재', latest]])
98
+ ? prettyResult(0, depth, command, `Updated ${current} → ${latest}.`, [['Previous', current], ['Current', latest]])
97
99
  : agentResult(0, { command, current, latest, packageManager: manager, updated: true });
98
100
  }