opencode-tbot 0.1.19 → 0.1.21

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/dist/plugin.js CHANGED
@@ -2136,17 +2136,22 @@ function toResolvedApproval(approval, reply) {
2136
2136
  updatedAt: (/* @__PURE__ */ new Date()).toISOString()
2137
2137
  };
2138
2138
  }
2139
- var SUPPORTED_BOT_LANGUAGES = ["en", "zh-CN"];
2139
+ var SUPPORTED_BOT_LANGUAGES = [
2140
+ "en",
2141
+ "zh-CN",
2142
+ "ja"
2143
+ ];
2140
2144
  var EN_BOT_COPY = {
2145
+ locale: "en",
2141
2146
  commands: {
2142
- start: "Welcome and quick start",
2147
+ start: "Show welcome and quick start",
2143
2148
  status: "Show system status",
2144
2149
  new: "Create a new session",
2145
- agents: "View and switch agents",
2146
- sessions: "View and switch sessions",
2150
+ agents: "Show and switch agents",
2151
+ sessions: "Show and switch sessions",
2147
2152
  cancel: "Cancel rename or abort running request",
2148
- model: "View and switch models",
2149
- language: "View and switch language"
2153
+ model: "Show and switch models",
2154
+ language: "Show and switch language"
2150
2155
  },
2151
2156
  start: { lines: [
2152
2157
  "# Welcome to opencode-tbot",
@@ -2239,7 +2244,7 @@ var EN_BOT_COPY = {
2239
2244
  none: "No sessions available in the current project.",
2240
2245
  title: "Session List",
2241
2246
  actionTitle: "Session Actions",
2242
- chooseAction: "Choose what to do with this session.",
2247
+ chooseAction: "Choose an action for this session.",
2243
2248
  currentProject(worktree) {
2244
2249
  return `Current project: ${worktree}`;
2245
2250
  },
@@ -2265,7 +2270,7 @@ var EN_BOT_COPY = {
2265
2270
  },
2266
2271
  switchAction: "Switch",
2267
2272
  renameAction: "Rename",
2268
- backToList: "Back",
2273
+ backToList: "Back to list",
2269
2274
  expired: "The session is no longer available. Run /sessions again."
2270
2275
  },
2271
2276
  lsp: {
@@ -2338,18 +2343,20 @@ var EN_BOT_COPY = {
2338
2343
  expired: "The language option is no longer available. Run /language again.",
2339
2344
  labels: {
2340
2345
  en: "English",
2341
- "zh-CN": "Simplified Chinese"
2346
+ "zh-CN": "简体中文",
2347
+ ja: "日本語"
2342
2348
  }
2343
2349
  }
2344
2350
  };
2345
2351
  var ZH_CN_BOT_COPY = {
2352
+ locale: "zh-CN",
2346
2353
  commands: {
2347
- start: "查看欢迎与快速开始",
2354
+ start: "查看欢迎信息与快速开始",
2348
2355
  status: "查看系统状态",
2349
2356
  new: "新建会话",
2350
- agents: "查看并切换代理",
2357
+ agents: "查看并切换 Agent",
2351
2358
  sessions: "查看并切换会话",
2352
- cancel: "取消重命名或中止运行中的请求",
2359
+ cancel: "取消重命名或中止当前请求",
2353
2360
  model: "查看并切换模型",
2354
2361
  language: "查看并切换语言"
2355
2362
  },
@@ -2444,7 +2451,7 @@ var ZH_CN_BOT_COPY = {
2444
2451
  none: "当前项目下没有可用会话。",
2445
2452
  title: "会话列表",
2446
2453
  actionTitle: "会话操作",
2447
- chooseAction: "请选择对该会话执行的操作。",
2454
+ chooseAction: "请选择该会话的操作。",
2448
2455
  currentProject(worktree) {
2449
2456
  return `当前项目: ${worktree}`;
2450
2457
  },
@@ -2452,7 +2459,7 @@ var ZH_CN_BOT_COPY = {
2452
2459
  return `当前会话: ${session}`;
2453
2460
  },
2454
2461
  selectedSession(session) {
2455
- return `目标会话: ${session}`;
2462
+ return `已选会话: ${session}`;
2456
2463
  },
2457
2464
  switched: "会话已切换。",
2458
2465
  created: "会话已创建。",
@@ -2499,13 +2506,13 @@ var ZH_CN_BOT_COPY = {
2499
2506
  }
2500
2507
  },
2501
2508
  agents: {
2502
- none: "没有可用代理。",
2503
- title: "代理列表",
2509
+ none: "没有可用 Agent。",
2510
+ title: "Agent 列表",
2504
2511
  current(agent) {
2505
- return `当前代理: ${agent}`;
2512
+ return `当前 Agent: ${agent}`;
2506
2513
  },
2507
- switched: "代理已切换。",
2508
- expired: "该代理已不可用。请重新运行 /agents。"
2514
+ switched: "Agent 已切换。",
2515
+ expired: " Agent 已不可用。请重新运行 /agents。"
2509
2516
  },
2510
2517
  models: {
2511
2518
  none: "没有可用模型。",
@@ -2535,7 +2542,7 @@ var ZH_CN_BOT_COPY = {
2535
2542
  },
2536
2543
  language: {
2537
2544
  title: "语言",
2538
- choose: "选择机器人菜单和回复信息的显示语言。",
2545
+ choose: "选择 Bot 菜单和回复的显示语言。",
2539
2546
  current(label) {
2540
2547
  return `当前语言: ${label}`;
2541
2548
  },
@@ -2543,7 +2550,215 @@ var ZH_CN_BOT_COPY = {
2543
2550
  expired: "该语言选项已不可用。请重新运行 /language。",
2544
2551
  labels: {
2545
2552
  en: "English",
2546
- "zh-CN": "简体中文"
2553
+ "zh-CN": "简体中文",
2554
+ ja: "日本語"
2555
+ }
2556
+ }
2557
+ };
2558
+ var JA_BOT_COPY = {
2559
+ locale: "ja",
2560
+ commands: {
2561
+ start: "ようこそとクイックスタートを表示",
2562
+ status: "システム状態を表示",
2563
+ new: "新しいセッションを作成",
2564
+ agents: "エージェントを表示して切り替え",
2565
+ sessions: "セッションを表示して切り替え",
2566
+ cancel: "名前変更を取り消すか実行中のリクエストを中止",
2567
+ model: "モデルを表示して切り替え",
2568
+ language: "言語を表示して切り替え"
2569
+ },
2570
+ start: { lines: [
2571
+ "# opencode-tbot へようこそ",
2572
+ "",
2573
+ "Telegram から OpenCode サーバーとやり取りできます。",
2574
+ "",
2575
+ "## クイックスタート",
2576
+ "1. `/status` を実行してサーバーの準備完了を確認します。",
2577
+ "2. `/new [title]` を実行して新しいセッションを作成します。",
2578
+ "",
2579
+ "そのままテキストまたは画像メッセージを送信できます。"
2580
+ ] },
2581
+ systemStatus: { title: "システム状態" },
2582
+ common: {
2583
+ notSelected: "未選択",
2584
+ openCodeDefault: "未選択(OpenCode のデフォルトを使用)",
2585
+ previousPage: "前へ",
2586
+ nextPage: "次へ",
2587
+ page(currentPage, totalPages) {
2588
+ return `ページ ${currentPage}/${totalPages}`;
2589
+ }
2590
+ },
2591
+ status: {
2592
+ processing: "処理中...",
2593
+ alreadyProcessing: "別のリクエストがまだ実行中です。完了するまで新しいプロンプトを送信しないでください。"
2594
+ },
2595
+ prompt: { emptyResponse: "OpenCode から空の応答が返されました。" },
2596
+ replyMetrics: {
2597
+ durationLabel: "所要時間",
2598
+ tokensLabel: "トークン",
2599
+ totalLabel: "合計",
2600
+ inputLabel: "入力",
2601
+ outputLabel: "出力",
2602
+ reasoningLabel: "推論",
2603
+ cacheReadLabel: "キャッシュ読込",
2604
+ cacheWriteLabel: "キャッシュ書込",
2605
+ notAvailable: "該当なし"
2606
+ },
2607
+ abort: {
2608
+ noSession: "このチャットにはまだアクティブなセッションが紐付いていません。",
2609
+ notRunning: "現在のセッションで実行中のリクエストはありません。",
2610
+ aborted: "現在のセッションに中止シグナルを送信しました。"
2611
+ },
2612
+ errors: {
2613
+ unexpected: "予期しないエラーが発生しました。",
2614
+ providerAuth: "Provider の認証に失敗しました。",
2615
+ requestAborted: "リクエストは中止されました。",
2616
+ promptTimeout: "OpenCode リクエストがタイムアウトしました。",
2617
+ structuredOutput: "構造化出力の検証に失敗しました。",
2618
+ voiceUnsupported: "音声メッセージには対応していません。代わりにテキストまたは画像を送信してください。",
2619
+ imageDownload: "Telegram の画像ファイルをダウンロードできませんでした。",
2620
+ imageUnsupported: "画像ファイルが大きすぎるか、サポートされていません。",
2621
+ outputLength: "返信がモデルの出力上限に達しました。",
2622
+ contextOverflow: "会話がモデルのコンテキスト上限を超えました。",
2623
+ providerRequest: "Provider へのリクエストに失敗しました。",
2624
+ notFound: "要求されたリソースが見つかりませんでした。",
2625
+ badRequest: "リクエストは OpenCode に拒否されました。",
2626
+ causeLabel: "原因",
2627
+ retryableLabel: "再試行可能",
2628
+ statusCodeLabel: "ステータス"
2629
+ },
2630
+ health: {
2631
+ title: "サーバー状態",
2632
+ status(healthy) {
2633
+ return `状態: ${healthy ? "正常" : "異常"}`;
2634
+ },
2635
+ version(version) {
2636
+ return `バージョン: ${version}`;
2637
+ }
2638
+ },
2639
+ path: {
2640
+ title: "現在のパス",
2641
+ home(path) {
2642
+ return `ホーム: ${path}`;
2643
+ },
2644
+ state(path) {
2645
+ return `状態: ${path}`;
2646
+ },
2647
+ config(path) {
2648
+ return `設定: ${path}`;
2649
+ },
2650
+ worktree(path) {
2651
+ return `ワークツリー: ${path}`;
2652
+ },
2653
+ directory(path) {
2654
+ return `現在の作業ディレクトリ: ${path}`;
2655
+ }
2656
+ },
2657
+ sessions: {
2658
+ none: "現在のプロジェクトで利用できるセッションはありません。",
2659
+ title: "セッション一覧",
2660
+ actionTitle: "セッション操作",
2661
+ chooseAction: "このセッションに対する操作を選択してください。",
2662
+ currentProject(worktree) {
2663
+ return `現在のプロジェクト: ${worktree}`;
2664
+ },
2665
+ currentSession(session) {
2666
+ return `現在のセッション: ${session}`;
2667
+ },
2668
+ selectedSession(session) {
2669
+ return `選択中のセッション: ${session}`;
2670
+ },
2671
+ switched: "セッションを切り替えました。",
2672
+ created: "セッションを作成しました。",
2673
+ renamed: "セッション名を変更しました。",
2674
+ renameCancelled: "セッション名の変更を取り消しました。",
2675
+ renameEmpty: "セッション名は空にできません。新しい名前を送信するか /cancel を実行してください。",
2676
+ renameExpired: "このセッションはもう利用できません。/sessions を再実行してください。",
2677
+ renamePendingInput: "新しいセッション名の入力待ちです。プレーンテキストを送るか /cancel を実行してください。",
2678
+ renamePrompt(session) {
2679
+ return [
2680
+ `セッション名を変更: ${session}`,
2681
+ "次のテキストメッセージで新しいセッション名を送信してください。",
2682
+ "/cancel で取り消します。"
2683
+ ].join("\n");
2684
+ },
2685
+ switchAction: "切り替え",
2686
+ renameAction: "名前変更",
2687
+ backToList: "一覧に戻る",
2688
+ expired: "このセッションはもう利用できません。/sessions を再実行してください。"
2689
+ },
2690
+ lsp: {
2691
+ none: "現在のプロジェクトで LSP サーバーは検出されませんでした。",
2692
+ title: "LSP サーバー",
2693
+ currentProject(worktree) {
2694
+ return `現在のプロジェクト: ${worktree}`;
2695
+ },
2696
+ connected: "接続済み",
2697
+ error: "エラー"
2698
+ },
2699
+ mcp: {
2700
+ none: "現在のプロジェクトで MCP サーバーは設定されていません。",
2701
+ title: "MCP サーバー",
2702
+ currentProject(worktree) {
2703
+ return `現在のプロジェクト: ${worktree}`;
2704
+ },
2705
+ connected: "接続済み",
2706
+ disabled: "無効",
2707
+ needsAuth: "認証が必要",
2708
+ failed(error) {
2709
+ return `失敗: ${error}`;
2710
+ },
2711
+ needsClientRegistration(error) {
2712
+ return `クライアント登録が必要: ${error}`;
2713
+ }
2714
+ },
2715
+ agents: {
2716
+ none: "利用可能なエージェントはありません。",
2717
+ title: "エージェント一覧",
2718
+ current(agent) {
2719
+ return `現在のエージェント: ${agent}`;
2720
+ },
2721
+ switched: "エージェントを切り替えました。",
2722
+ expired: "このエージェントはもう利用できません。/agents を再実行してください。"
2723
+ },
2724
+ models: {
2725
+ none: "利用可能なモデルはありません。",
2726
+ title: "モデル一覧",
2727
+ configuredOnly: "OpenCode と接続済み provider で現在利用可能なモデルのみ表示します。",
2728
+ current(model) {
2729
+ return `現在のモデル: ${model}`;
2730
+ },
2731
+ switched: "モデルを切り替えました。",
2732
+ currentReasoningLevel(variant) {
2733
+ return `現在の推論レベル: ${variant}`;
2734
+ },
2735
+ reasoningLevel(variant) {
2736
+ return `推論レベル: ${variant}`;
2737
+ },
2738
+ noReasoningLevels: "このモデルには選択可能な推論レベルがありません。",
2739
+ reasoningLevelsTitle: "推論レベル",
2740
+ model(model) {
2741
+ return `モデル: ${model}`;
2742
+ },
2743
+ modelNumber(modelIndex) {
2744
+ return `モデル番号: ${modelIndex}`;
2745
+ },
2746
+ expired: "このモデルはもう利用できません。/model を再実行してください。",
2747
+ reasoningLevelExpired: "この推論レベルはもう利用できません。/model を再実行してください。",
2748
+ defaultReasoningLevel: "デフォルト"
2749
+ },
2750
+ language: {
2751
+ title: "言語",
2752
+ choose: "Bot のメニューと返信に使う表示言語を選択してください。",
2753
+ current(label) {
2754
+ return `現在の言語: ${label}`;
2755
+ },
2756
+ switched: "言語を切り替えました。",
2757
+ expired: "この言語オプションはもう利用できません。/language を再実行してください。",
2758
+ labels: {
2759
+ en: "English",
2760
+ "zh-CN": "简体中文",
2761
+ ja: "日本語"
2547
2762
  }
2548
2763
  }
2549
2764
  };
@@ -2555,10 +2770,14 @@ function normalizeBotLanguage(value) {
2555
2770
  if (!value) return "en";
2556
2771
  const normalized = value.trim().toLowerCase();
2557
2772
  if (normalized === "zh-cn" || normalized === "zh-hans" || normalized === "zh") return "zh-CN";
2773
+ if (normalized === "ja" || normalized === "ja-jp" || normalized === "ja_jp") return "ja";
2558
2774
  return "en";
2559
2775
  }
2560
2776
  function getBotCopy(language = "en") {
2561
- return normalizeBotLanguage(language) === "zh-CN" ? ZH_CN_BOT_COPY : EN_BOT_COPY;
2777
+ const normalized = normalizeBotLanguage(language);
2778
+ if (normalized === "zh-CN") return ZH_CN_BOT_COPY;
2779
+ if (normalized === "ja") return JA_BOT_COPY;
2780
+ return EN_BOT_COPY;
2562
2781
  }
2563
2782
  function getLanguageLabel(language, copy = BOT_COPY) {
2564
2783
  return copy.language.labels[language];
@@ -2928,10 +3147,6 @@ function presentStatusPlainLspLines(input, copy, layout) {
2928
3147
  return input.lsp.data.statuses.flatMap((status) => presentPlainStatusGroup(status.name, [{
2929
3148
  label: layout.statusLabel,
2930
3149
  value: formatLspStatusBadge(status)
2931
- }, {
2932
- codeValue: !!status.root,
2933
- label: layout.rootLabel,
2934
- value: status.root || "-"
2935
3150
  }]));
2936
3151
  }
2937
3152
  function presentStatusMarkdownLspLines(input, copy, layout) {
@@ -2940,10 +3155,6 @@ function presentStatusMarkdownLspLines(input, copy, layout) {
2940
3155
  return input.lsp.data.statuses.flatMap((status) => presentMarkdownStatusGroup(status.name, [{
2941
3156
  label: layout.statusLabel,
2942
3157
  value: formatLspStatusBadge(status)
2943
- }, {
2944
- codeValue: !!status.root,
2945
- label: layout.rootLabel,
2946
- value: status.root || "-"
2947
3158
  }]));
2948
3159
  }
2949
3160
  function presentStatusPlainMcpLines(input, copy, layout) {
@@ -3040,7 +3251,7 @@ function normalizeStatusInlineValue(value) {
3040
3251
  return formatStatusValue(value);
3041
3252
  }
3042
3253
  function getStatusLayoutCopy(copy) {
3043
- if (copy.systemStatus.title === BOT_COPY.systemStatus.title) return {
3254
+ if (copy.locale === "en") return {
3044
3255
  connectivityLabel: "Connectivity",
3045
3256
  currentProjectLabel: "Current Project",
3046
3257
  currentSessionLabel: "Current Session",
@@ -3057,11 +3268,31 @@ function getStatusLayoutCopy(copy) {
3057
3268
  openCodeVersionLabel: "OpenCode Version",
3058
3269
  overviewTitle: "🖥️ Overview",
3059
3270
  pluginsTitle: "🧩 Plugins",
3060
- rootLabel: "Root",
3061
3271
  statusLabel: "Status",
3062
3272
  tbotVersionLabel: "opencode-tbot Version",
3063
3273
  workspaceTitle: "📁 Workspace"
3064
3274
  };
3275
+ if (copy.locale === "ja") return {
3276
+ connectivityLabel: "接続性",
3277
+ currentProjectLabel: "現在のプロジェクト",
3278
+ currentSessionLabel: "現在のセッション",
3279
+ defaultSessionValue: "OpenCode のデフォルト",
3280
+ detailsLabel: "詳細",
3281
+ errorStatus: "🔴",
3282
+ lspTitle: "🧠 LSP",
3283
+ mcpFailedStatus: "🔴",
3284
+ mcpNotesLabel: "補足",
3285
+ mcpRegistrationRequiredStatus: "🟡",
3286
+ mcpTitle: "🔌 MCP",
3287
+ noPluginsMessage: "現在の OpenCode 設定にはプラグインが設定されていません。",
3288
+ noneStatus: "⚪",
3289
+ openCodeVersionLabel: "OpenCode バージョン",
3290
+ overviewTitle: "🖥️ 概要",
3291
+ pluginsTitle: "🧩 プラグイン",
3292
+ statusLabel: "状態",
3293
+ tbotVersionLabel: "opencode-tbot バージョン",
3294
+ workspaceTitle: "📁 ワークスペース"
3295
+ };
3065
3296
  return {
3066
3297
  connectivityLabel: "连通性",
3067
3298
  currentProjectLabel: "当前项目",
@@ -3079,7 +3310,6 @@ function getStatusLayoutCopy(copy) {
3079
3310
  openCodeVersionLabel: "OpenCode版本",
3080
3311
  overviewTitle: "🖥️ 概览",
3081
3312
  pluginsTitle: "🧩 插件",
3082
- rootLabel: "根目录",
3083
3313
  statusLabel: "状态",
3084
3314
  tbotVersionLabel: "opencode-tbot版本",
3085
3315
  workspaceTitle: "📁 工作区"