@tocca-systems/twp-cli 0.45.0 → 0.47.0

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 (75) hide show
  1. package/CHANGELOG.public.md +16 -0
  2. package/README.md +34 -7
  3. package/dist/{agent-loop-RMJXHBNG.js → agent-loop-XKH5YE6A.js} +1 -1
  4. package/dist/{ai-dispatch-L6XZCCU4.js → ai-dispatch-FGVNSM6L.js} +2 -2
  5. package/dist/{api-command-6C3MFXVU.js → api-command-PQ435C3B.js} +2 -2
  6. package/dist/{app-6DA35MYO.js → app-227MZT5L.js} +3 -3
  7. package/dist/{backlog-Q7VYDMDL.js → backlog-F6TNQG4I.js} +1 -1
  8. package/dist/chunk-3AD2T6L2.js +64 -0
  9. package/dist/{chunk-JNPCHV7S.js → chunk-3B5PVPGU.js} +1 -1
  10. package/dist/{chunk-XUNFV6ZQ.js → chunk-4ZTWRAHM.js} +1 -1
  11. package/dist/{chunk-QV6DH37Q.js → chunk-ACPGM5KP.js} +1 -1
  12. package/dist/{chunk-IOCNJMVW.js → chunk-AUAZP2G7.js} +5 -5
  13. package/dist/{chunk-XTREYDO5.js → chunk-CEBL5R62.js} +1 -1
  14. package/dist/{chunk-JLNY7HRM.js → chunk-DPGQ36DA.js} +1 -1
  15. package/dist/{chunk-N6AXAGS2.js → chunk-EZGN7PTO.js} +1 -1
  16. package/dist/{chunk-NAAMNYX3.js → chunk-JBX4OEHV.js} +1 -1
  17. package/dist/{chunk-G2THOTBW.js → chunk-JTJWDV5U.js} +1 -1
  18. package/dist/{chunk-EWTFE233.js → chunk-KPXJALCL.js} +1 -1
  19. package/dist/{chunk-DVKPGJMS.js → chunk-LKS7GANP.js} +1 -1
  20. package/dist/{chunk-EM3SDCCU.js → chunk-LLOXVVFK.js} +15 -14
  21. package/dist/{chunk-L25UV7DE.js → chunk-LUQ2KE6Y.js} +1 -1
  22. package/dist/{chunk-Y4SREWAG.js → chunk-MXKAEPXA.js} +1 -1
  23. package/dist/{chunk-XXVYGQ72.js → chunk-P7JCZYAI.js} +1 -1
  24. package/dist/{chunk-O3UQPM6L.js → chunk-PSWDEV6M.js} +1 -1
  25. package/dist/{chunk-ZM3MTWNT.js → chunk-SA7A5WF2.js} +1 -1
  26. package/dist/{chunk-AITUMFCH.js → chunk-TKGVAWGU.js} +1 -1
  27. package/dist/{chunk-YPMT453N.js → chunk-VIU2HPWM.js} +1 -1
  28. package/dist/chunk-WPY6OQOT.js +9 -0
  29. package/dist/{chunk-D5FEOBB6.js → chunk-XWW63XJJ.js} +44 -35
  30. package/dist/{chunk-7GSTR64T.js → chunk-ZFTKBOGN.js} +1 -1
  31. package/dist/{chunk-DS5TH5YQ.js → chunk-ZTIR3NSH.js} +1 -1
  32. package/dist/cli.js +35 -8
  33. package/dist/{commands-5GP3REIU.js → commands-EIWS357Q.js} +44 -41
  34. package/dist/{commands-JUD4ZNWT.js → commands-SWR442MR.js} +1 -1
  35. package/dist/{company-UTEAM246.js → company-X37NKBWH.js} +2 -2
  36. package/dist/{contract-GUY73GRP.js → contract-YRMK73XV.js} +1 -1
  37. package/dist/{department-QMTJYMN2.js → department-WKV46OIM.js} +1 -1
  38. package/dist/{deposit-FOATHWXV.js → deposit-75KCQBCE.js} +1 -1
  39. package/dist/{estimate-6UWI7SKV.js → estimate-LA7WXYTV.js} +2 -2
  40. package/dist/{inquiry-3VBBJT2K.js → inquiry-NHDMHZXX.js} +1 -1
  41. package/dist/{invoice-FOZJR42A.js → invoice-WVCRD2MT.js} +2 -2
  42. package/dist/{job-title-IIRFPZNV.js → job-title-FSVZSCMO.js} +1 -1
  43. package/dist/{knowledge-6SXUV46K.js → knowledge-J6TFEPMP.js} +1 -1
  44. package/dist/{leave-LQAXN6F4.js → leave-MWDZOGQH.js} +1 -1
  45. package/dist/media-66FCDEMZ.js +125 -0
  46. package/dist/{notification-NTU3JCR2.js → notification-ZZV4M24X.js} +1 -1
  47. package/dist/onedrive-3OBI4B5Z.js +51 -0
  48. package/dist/{oneshot-67EDIE2F.js → oneshot-C2GOGRLM.js} +1 -1
  49. package/dist/outlook-LY6WBXIJ.js +94 -0
  50. package/dist/{position-WGLV3JZ6.js → position-G24ALWEO.js} +1 -1
  51. package/dist/{project-REBUFMPX.js → project-WKWOVDVA.js} +1 -1
  52. package/dist/{prospect-DJAJNTRQ.js → prospect-SS2Z4UNJ.js} +1 -1
  53. package/dist/{purchase-7RVUWXMS.js → purchase-YPTIOSG6.js} +2 -2
  54. package/dist/{receivable-SHRWUYJW.js → receivable-G7TYHCBD.js} +1 -1
  55. package/dist/{registry-CP4LGNGZ.js → registry-RPVLCPFY.js} +1 -1
  56. package/dist/{render-4L5BDU3B.js → render-R5QZ46GF.js} +1 -1
  57. package/dist/{report-SUTO7E7Z.js → report-EILA6LJW.js} +1 -1
  58. package/dist/{run-NVS532DL.js → run-VGH3UT6R.js} +1 -1
  59. package/dist/{sales-ai-review-LC4XDQLS.js → sales-ai-review-57QGRYMZ.js} +1 -1
  60. package/dist/{sales-master-C4EYXIKP.js → sales-master-7SWNOWZS.js} +1 -1
  61. package/dist/{sales-numbering-YK447QBC.js → sales-numbering-TQS3PUV7.js} +1 -1
  62. package/dist/{schedule-command-7JGQMTQY.js → schedule-command-QCGEMBVR.js} +1 -1
  63. package/dist/{server-settings-3E7G56G7.js → server-settings-TUBJ4P57.js} +1 -1
  64. package/dist/{server-skills-OF7USNRM.js → server-skills-Z5DGCJQ7.js} +1 -1
  65. package/dist/{supplier-payment-MLLTGVCO.js → supplier-payment-IORFZDHV.js} +1 -1
  66. package/dist/{task-7SKWCZWV.js → task-TK37X5JF.js} +35 -30
  67. package/dist/teams-DRHXPLWN.js +93 -0
  68. package/dist/{user-FPXO3IHG.js → user-O4N3RNPO.js} +2 -2
  69. package/dist/{workflow-FU2EBVBW.js → workflow-JSBBY3V5.js} +1 -1
  70. package/package.json +1 -1
  71. package/dist/chunk-C2MQANJO.js +0 -9
  72. package/dist/media-VK6AUGZY.js +0 -63
  73. package/dist/onedrive-XAFONTRT.js +0 -16
  74. package/dist/outlook-PQ4OCB5Z.js +0 -98
  75. package/dist/teams-RDBKQJMM.js +0 -50
@@ -11,6 +11,22 @@
11
11
  `CHANGELOG.md` に残してあります。顧客向けの履歴は public 公開以降を対象とします。
12
12
  -->
13
13
 
14
+ ## 0.47.0
15
+
16
+ `twp onedrive link create` で `--drive` を省略して自分の OneDrive のファイルに共有リンクを作ろうとすると、エラーになって作れなかった不具合を修正しました。
17
+
18
+ `twp task-loop` で、別の OS 専用のアイテムだけがキューに残っているときに、その機体が新しい作業を計画せず待ち続けることがある問題を修正しました。
19
+
20
+ `twp task create` / `twp task update` で、タスクを実行できる機体のプラットフォームを `--required-platforms`(mac / windows / linux)で指定できるようになりました。`--clear required-platforms` で制約を外せ、`twp task get` にも表示されます。
21
+
22
+ メディアライブラリのフォルダを CLI で作成・名前変更・移動・削除・復元できるようになりました(`twp media folder`)。`twp media folder list --tree --output text` でフォルダの階層を表示でき、ファイルのアップロードや一覧の `--folder` には「営業/2026/資料」のようなフォルダのパスも指定できます。
23
+
24
+ ## 0.46.0
25
+
26
+ Teams のチャットへのメッセージ送信・チャネルへの投稿・スレッドへの返信を `twp teams message send` / `twp teams reply send` で行えるようになりました。投稿はメンバーへ通知が届くため `--yes` の指定が必要で、`--dry-run` で送信先と本文を事前に確認できます。`--mention` でメンションも付けられます。
27
+
28
+ Outlook の予定を `twp outlook event create` / `update` / `delete` で作成・更新・削除できるようになりました。出席者がいる予定では通知が相手に届くため `--yes` の指定が必要で、`--dry-run` で内容と通知が届く相手を事前に確認できます。また、`twp onedrive item upload` で OneDrive へファイルをアップロードし(250MB まで・同名は上書きしません)、`twp onedrive link create` で組織内または匿名の共有リンクを作れるようになりました。
29
+
14
30
  ## 0.45.0
15
31
 
16
32
  予実管理を `twp budget` で扱えるようになりました。年度の予実ダッシュボード・サマリー・部署ごとの内訳・CSV 出力に加え、目標の一覧・まとめての登録・前年度からのコピー・CSV での取り込み(雛形の書き出しを含む)と、プロジェクトの部署按分の参照と設定ができます。既存の目標や按分を上書きする操作は、実行前に今の値を表示し、`--yes` の指定が必要です。
package/README.md CHANGED
@@ -25,7 +25,7 @@ TWP(Tocca Working Platform)を、ターミナルから使うための CLI
25
25
  | **できる** | `twp inquiry category` による問い合わせカテゴリの一覧・取得・作成・更新(通知先の設定・末尾への並べ替えを含む)。取得・作成・更新は問い合わせ機能の管理者の権限が要ります |
26
26
  | **できる** | `twp notification` による自分宛ての通知の一覧(未読・カテゴリ・語で絞り込み)・詳細・未読件数・カテゴリ一覧と、1件ずつ・まとめての既読化 |
27
27
  | **できる** | `twp estimate` / `twp invoice` による販売管理の見積・請求の一覧(語・ステータス・取引先・プロジェクト・担当者・日付・回収状況で絞り込み)と詳細、`twp estimate` による見積の作成・更新・削除・社内共有メモ・既存の請求の紐づけ・関連入金・部署按分・案件書類(注文書・個別契約書など)の登録・版の差替え・ダウンロードと、注文書からの注文書番号の読み取り・見積書/注文書/注文請書の PDF の書き出し、`twp invoice` による請求の作成・更新・削除・取消と取消解除・統合請求書の作成・社内共有メモ・CSV/MF 会計仕訳の書き出し・請求書メールの送信・支払いリンクの作成・請求書/納品書/検収書の PDF の書き出し、`twp contract` による取引契約(見積から作る販売管理の契約)の一覧・詳細・作成・更新・削除、`twp invoice auto-template` による自動請求テンプレートの一覧・詳細・作成・更新・削除と発行履歴の参照(販売管理の管理者)、`twp deposit` による入金の一覧・詳細・登録・更新・削除・CSV 書き出し、請求への引当(CSV での一括を含む)・解除・手数料分の引き上げ、入金予定からの入金と引当のまとめ登録、`twp receivable` による売掛金残高の表示と CSV 書き出し・月次の締めと締めの解除(どちらも販売管理の管理者)、`twp purchase` による仕入(注文書)の一覧・詳細・作成・更新・削除・複製・一覧のメモ・注文書/注文請書の PDF の書き出しと、添付書類(見積書・注文書・注文請書)の登録・版の差替え・ダウンロード、添付した見積書からの AI 読み取り(候補を出すだけで仕入は変えません)、`twp supplier-payment` による支払(仕入先へ払うお金の台帳)の一覧・詳細・登録・更新・削除・ID を並べたファイルでのステータスの一括変更と、毎月の支払を生成する支払先マスタの一覧・詳細・登録・更新・削除(どちらも販売管理の管理者)、`twp business-place` / `twp payee` / `twp seal-impression` による帳票に載る自社の事業所・振込先・印影(画像の登録を含む)の一覧・詳細・登録・更新・削除(書き込みは販売管理の管理者。振込先の一覧は口座番号を伏字にします)、`twp purchase ai-mapping` による見積書 AI 読み取りのマッピング表の一覧・詳細・登録・更新・削除と反映先の選択肢、`twp estimate no-rule` / `twp invoice no-rule` / `twp purchase no-rule` による見積・請求・仕入の番号ルールの一覧(次に発行される番号つき)・詳細・登録・更新・削除と、`twp estimate format` による見積フォーマット(書類を作るときの既定値の組)の一覧・詳細・作成・更新・削除、`twp rounding-setting` による端数処理(金額の丸め方)の表示と変更(番号ルールと端数処理の変更は `--yes` が要り、変更前・変更後を出します)、`twp company` / `twp customer` による取引先企業・顧客の一覧と詳細(名前でも指定できます)、`twp customer` による顧客の登録・更新・削除(担当者・対応履歴ごと。ID を並べたファイルでの一括削除を含む)と担当者・対応履歴の一覧・詳細・登録・更新・削除、全顧客の最近の対応、名刺画像の登録・裏面メモ・削除、企業をまたいだ人物の一覧・詳細・CSV 書き出し、登録前の類似企業検索、`twp company` による取引先企業(仕入先を含む)の登録・更新・削除、`twp prospect` によるアプローチ先(見込客)の一覧・登録・更新・削除・CSV での一括登録と書き出し・重複確認・顧客への昇格と対応履歴の記録、`twp estimate|invoice|contract ai-review` による申請前AIチェックの実行(`--wait` で完了まで待つ)・結果の表示・指摘への確認済みの理由の登録と取消、`twp ai-review-reason` による理由の横断一覧・社内ナレッジへの追記文案の生成と追記PRの作成(販売管理の管理者)。販売管理・顧客管理の権限が要ります |
28
- | **できる** | `twp media` によるメディアライブラリのファイルのアップロード・一覧・ダウンロード・削除(ゴミ箱へ移す)・一括操作(公開・非公開・アーカイブ・移動・削除・復元・ZIP ダウンロード)、`twp storage get` によるストレージ使用量の確認(管理者) |
28
+ | **できる** | `twp media` によるメディアライブラリのファイルのアップロード・一覧・ダウンロード・削除(ゴミ箱へ移す)・一括操作(公開・非公開・アーカイブ・移動・削除・復元・ZIP ダウンロード)、`twp media folder` によるフォルダの一覧・ツリー表示・作成・名前変更・移動・削除・ゴミ箱からの復元と完全削除(`--folder` はフォルダID のほか「親/子」形式のパスでも指定可)、`twp storage get` によるストレージ使用量の確認(管理者) |
29
29
  | **できる** | `twp attendance` による自分の勤怠の参照(いまの打刻状態・打刻の履歴・月の勤怠表)と打刻、管理者向けの残業サマリ(36協定を含む)・締め状況の参照 |
30
30
  | **できる** | `twp leave` による有給の残日数・取得履歴・付与履歴の参照と有給の申請(`twp leave request`)、`twp workchange list` / `twp shift list` による月の勤務変更・シフトの参照(`--me` で自分の分・無ければ全員分=勤怠の管理者) |
31
31
  | **できる** | `twp analysis` による分析の読み取り(稼働分析・プロジェクトアサイン・人材別アサインを月ごとの列で、今週のキャパシティと過負荷アラート・再分配候補・標準勤務時間の設定、負荷のリスク判定、プロジェクト健全性スコアの一覧・推移と AI の所見)、`twp project manhours` / `twp task manhours` による工数の集計、`twp project workload` によるメンバーごとのタスク件数。分析の権限と、ページごとの閲覧対象への登録が要ります |
@@ -33,7 +33,7 @@ TWP(Tocca Working Platform)を、ターミナルから使うための CLI
33
33
  | **できる** | `twp workflow` による、自分が申請できる申請書・申請書の定義(管理者)・自分の申請・承認履歴・自分の承認待ちの参照(申請書は名前でも指定できます)と、申請の起票・提出・更新・削除、承認・却下・差し戻し・取下げ |
34
34
  | **できる** | `twp report` による自分のレポート(日報)の一覧(フォーマット・状態・語で絞り込み)・詳細と、下書きの作成(フォーマットの入力項目から雛形を出せます)・更新・提出、使えるレポートフォーマットの一覧 |
35
35
  | **できる** | `twp wiki` / `twp note` / `twp meeting` による、wiki ページ(親ページ直下の子の一覧を含む)・ノート・議事録(開催日の期間で絞り込み)の一覧と、本文を `--output text` で文書として読むこと |
36
- | **できる** | `twp outlook` / `twp teams` / `twp onedrive` による Microsoft 365 の読み取り(メール・添付・予定、Teams のチーム・チャネル・チャット・メッセージ・スレッド返信・自分宛てメンション、OneDrive のファイルの一覧・情報・ダウンロード)。TWP に Microsoft アカウントでログインしたことがあるユーザーが対象です。書き込みはメールの送信・返信・全員返信・転送(`twp outlook mail send` / `reply` / `reply-all` / `forward`・`--yes` が必要)ができ、Teams の投稿・OneDrive・予定の書き込みはまだできません |
36
+ | **できる** | `twp outlook` / `twp teams` / `twp onedrive` による Microsoft 365 の読み取り(メール・添付・予定、Teams のチーム・チャネル・チャット・メッセージ・スレッド返信・自分宛てメンション、OneDrive のファイルの一覧・情報・ダウンロード)。TWP に Microsoft アカウントでログインしたことがあるユーザーが対象です。書き込みはメールの送信・返信・全員返信・転送(`twp outlook mail send` / `reply` / `reply-all` / `forward`)、Teams のチャット送信・チャネル投稿・スレッド返信(`twp teams message send` / `reply send`)、予定の作成・更新・削除(`twp outlook event create` / `update` / `delete`)、共有リンクの作成(`twp onedrive link create`)ができ(いずれも `--yes` が必要)、OneDrive へのアップロード(`twp onedrive item upload`)もできます |
37
37
  | **できる** | `twp task-loop` による、TWP のタスクキューを手元の AI CLI に実行させる常駐ループ |
38
38
  | **できる** | `twp agent-loop` による、エージェントループのキューの一覧・投入・更新・先頭への移動・削除と、期間を指定した実行履歴の参照。更新・移動・削除はテナントの管理者の権限が要ります |
39
39
  | **できる** | `twp completion bash` / `zsh` / `fish` / `powershell` によるシェル補完(コマンド名・操作名・フラグ名。プロジェクトやステータスの値は補完しません)と、`twp configure` による既定のプロジェクト・出力形式・既定プロファイルの対話設定 |
@@ -699,18 +699,27 @@ twp prospect interaction list|create|update|delete [<対応履歴ID>] --prospect
699
699
  ### メディアライブラリのファイルを扱う
700
700
 
701
701
  ```bash
702
- twp media list [--project <コード|ID>] [--folder <フォルダID>] [--keyword <語>] [--all]
703
- twp media upload --file <パス> [--project <コード|ID>] [--folder <フォルダID>] [--name <ファイル名>] [--content-type <型>]
702
+ twp media list [--project <コード|ID>] [--folder <ID|パス>] [--keyword <語>] [--all]
703
+ twp media upload --file <パス> [--project <コード|ID>] [--folder <ID|パス>] [--name <ファイル名>] [--content-type <型>]
704
704
  twp media download <ファイルID> --out <パス> [--force]
705
705
  twp media delete <ファイルID> --yes
706
706
  twp media bulk-publish | bulk-unpublish | bulk-archive | bulk-restore <ファイルID>...
707
- twp media bulk-move <ファイルID>... [--project <コード|ID>] [--folder <フォルダID>]
707
+ twp media bulk-move <ファイルID>... [--project <コード|ID>] [--folder <ID|パス>]
708
708
  twp media bulk-delete <ファイルID>... --yes [--permanent]
709
709
  twp media bulk-download <ファイルID>... --out <パス.zip> [--force]
710
+ twp media folder list [--project <コード|ID>] [--parent <ID|パス>] [--tree | --trash] [--all]
711
+ twp media folder get <ID|パス> [--project <コード|ID>]
712
+ twp media folder create <名前> [--parent <ID|パス>] [--project <コード|ID>]
713
+ twp media folder update <ID|パス> --name <新しい名前>
714
+ twp media folder move <ID|パス> (--parent <ID|パス> | --root)
715
+ twp media folder delete <ID|パス> --yes [--recursive] [--permanent]
716
+ twp media folder restore <ID> [--project <コード|ID>]
710
717
  twp storage get
711
718
  ```
712
719
 
713
- - **`--project` を付けたときだけプロジェクトのファイル**、無ければ自分の個人ファイルが対象です(`TWP_PROJECT` などの既定プロジェクトは使いません)。フォルダはフォルダID(UUID)で指定します
720
+ - **`--project` を付けたときだけプロジェクトのファイル**、無ければ自分の個人ファイルが対象です(`TWP_PROJECT` などの既定プロジェクトは使いません)。フォルダ(`--folder` / `--parent`)はフォルダID(UUID)か「親/子/孫」形式のパスで指定します。パスは `--project` のスコープのフォルダツリーから解決し、同名が複数あるときや見つからないときは候補を出して終了コード 2 で止まります
721
+ - **`twp media folder list --tree` はフォルダの階層をインデントで表示します**(`--output text` は行頭の字下げ、`--output table` は `tree` 列)。 既定の `list` は `--parent`(無ければ最上位)の直下だけ、`--trash` はゴミ箱のフォルダです
722
+ - **`twp media folder delete` は送る前に中身(サブフォルダ・ファイルの件数)を確かめ、中身があるのに `--recursive` が無ければ止めます。** 既定はゴミ箱へ移すだけで `twp media folder restore` で戻せます。`--permanent` はゴミ箱にあるフォルダだけを完全に削除し、復元できません(ID で指定)。同名のフォルダの作成・自分の下位フォルダへの移動も送る前に止めます(サーバはこれらの理由を返さないため)
714
723
  - **`twp media upload` はアップロード用URLの発行・ファイルの転送・完了登録を1コマンドで行い、サーバが計算した sha256 をローカルのファイルと突き合わせます。** 一致しなければ失敗で終わります。`--dry-run` はURLの発行リクエストだけを表示します(その前に送る容量検査は注記で知らせます)
715
724
  - **転送や完了登録に失敗したときは、ファイルIDと再登録・破棄のコマンドを stderr に出して失敗で終わります。** タスク添付と違い、URLを発行した時点でファイルが仮登録され**自動では消えない**ので、表示されたコマンドのどちらかを実行してください
716
725
  - `twp media delete` はゴミ箱へ移すだけで、画面から復元できます
@@ -941,7 +950,7 @@ twp backlog issue update <課題キー> [--assignee <名前|ID>] [--status <
941
950
 
942
951
  ### Microsoft 365(Outlook・Teams・OneDrive)を読む
943
952
 
944
- TWP に Microsoft アカウントでログインしたことがあるユーザーは、自分のメール・予定・Teams・OneDrive を読めます。メールは送信・返信・転送もできます(Teams・OneDrive・予定の書き込みは今後追加します)。
953
+ TWP に Microsoft アカウントでログインしたことがあるユーザーは、自分のメール・予定・Teams・OneDrive を読めます。メールの送信・返信・転送、Teams のチャット送信・チャネル投稿・スレッド返信、予定の作成・更新・削除、OneDrive へのアップロードと共有リンクの作成もできます。
945
954
 
946
955
  ```
947
956
  twp outlook mail list [--folder <名前|ID>] [--unread] [--search <語>] [--filter <OData>] [--orderby <OData>]
@@ -957,6 +966,11 @@ twp outlook attachment download <メールID> <添付ID> --out <パス>
957
966
  twp outlook event list [--from <yyyy-MM-dd>] [--to <yyyy-MM-dd>] [--filter <OData>] [--orderby <OData>]
958
967
  [--select <項目>] [--limit <件数>] [--all]
959
968
  twp outlook event get <予定ID>
969
+ twp outlook event create --subject <件名> --start <yyyy-MM-ddTHH:mm> --end <yyyy-MM-ddTHH:mm> [--time-zone <IANA名>]
970
+ [--all-day] [--body-file <パス> | --body <文字列>] [--html] [--location <場所>]
971
+ [--attendee <アドレス> …] [--optional-attendee <アドレス> …] [--online-meeting] --yes
972
+ twp outlook event update <予定ID> [上と同じ項目のうち変えるもの] [--clear-attendees] --yes
973
+ twp outlook event delete <予定ID> --yes
960
974
 
961
975
  twp teams team list # --team に渡す id / 名前
962
976
  twp teams member list --team <名前|ID>
@@ -964,13 +978,19 @@ twp teams channel list --team <名前|ID> # --channel に渡す id
964
978
  twp teams channel folder --team <名前|ID> --channel <名前|ID> # チャネルのファイルの driveId
965
979
  twp teams chat list [--limit <件数>] [--all] # --chat に渡す id
966
980
  twp teams message list (--chat <ID> | --team <名前|ID> --channel <名前|ID>) [--limit <件数>] [--all]
981
+ twp teams message send (--chat <ID> | --team <名前|ID> --channel <名前|ID>) (--body-file <パス> | --body <文字列>)
982
+ [--html] [--mention <ユーザーID>=<表示名> …] --yes
967
983
  twp teams reply list <投稿ID> --team <名前|ID> --channel <名前|ID>
984
+ twp teams reply send <投稿ID> --team <名前|ID> --channel <名前|ID> (--body-file <パス> | --body <文字列>)
985
+ [--html] [--mention <ユーザーID>=<表示名> …] --yes
968
986
  twp teams mention list [--since <日時>] [--until <日時>] [--unread] [--scope chats|channels|all] [--limit <件数>]
969
987
  [--type user,tag,conversation]
970
988
 
971
989
  twp onedrive item list [<フォルダID>] [--drive <ID>] [--limit <件数>] [--all]
972
990
  twp onedrive item get <項目ID> [--drive <ID>]
973
991
  twp onedrive item download <項目ID> --out <パス> [--drive <ID>]
992
+ twp onedrive item upload <ローカルのパス> [--folder <フォルダID>] [--name <名前>] [--drive <ID>]
993
+ twp onedrive link create <項目ID> --scope organization|anonymous [--type view|edit] [--drive <ID>] --yes
974
994
  ```
975
995
 
976
996
  - **Microsoft 365 と連携していないと、連携の手順を表示して終了コード 3 で止まります。** TWP の画面で「Microsoftアカウントでログイン」から一度ログインすると連携されます(`twp login` のやり直しは要りません)
@@ -985,6 +1005,13 @@ twp onedrive item download <項目ID> --out <パス> [--drive <ID>]
985
1005
  - 本文は既定でテキストとして送ります。返信・転送の本文は Microsoft 365 が HTML として読むので、改行と記号が見たとおりに届くよう HTML に直して送ります。`--html` を付けると HTML のまま送ります
986
1006
  - 添付(`--attach`)は合計 3MB までです(Microsoft 365 がメールに直接載せられる上限)
987
1007
  - 送信に失敗して終了コード 4 になっても、送信済みのことがあります。打ち直す前に `twp outlook mail list --folder sentitems` で確かめてください
1008
+ - ⚠ **Teams のチャット送信・チャネル投稿・スレッド返信は、実行した瞬間にメンバーへ通知が届きます。** `--yes` が無ければ実行しません。`--dry-run` で送信先(チーム・チャネルの表示名と ID、チャットの ID)と本文を確かめてから `--yes` を付けてください。チーム・チャネルは ID で指定しても参加中の一覧で引き直し、一意に決まらなければ送りません
1009
+ - Teams の本文は既定でテキストとして扱い、改行と記号が見たとおりに表示されるよう HTML に直して送ります(`--html` で HTML のまま)。メンションは `--mention <ユーザーID>=<表示名>` で、本文中の最初の `@<表示名>` がメンションになります(無ければ送りません。ユーザーID は `twp teams member list` の `userId`)
1010
+ - 投稿に失敗して終了コード 4 になっても、投稿済みのことがあります。打ち直す前に `twp teams message list` / `reply list` で確かめてください
1011
+ - ⚠ **予定の作成・更新・削除は、出席者がいれば招待・更新・キャンセルの通知が相手へ届き取り消せません。** 3つとも `--yes` が無ければ実行しません。更新・削除は送る前に予定を読み、通知が届く相手(いまの出席者)を表示します。`--attendee` を付けない予定は自分の予定表だけに入ります
1012
+ - 予定の日時は `--start` / `--end` に `yyyy-MM-ddTHH:mm` で、タイムゾーンを付けずに指定します(タイムゾーンは `--time-zone`・既定 Asia/Tokyo)。`--all-day` の終日予定は日付で指定し、`--end` は Microsoft 365 と同じく**最終日の翌日**です(10/5〜10/6 の2日間なら `--start 2026-10-05 --end 2026-10-07`。作成で省くと1日の予定)。作成・更新で終了コード 4 になっても反映済みのことがあるので、打ち直す前に `twp outlook event list` で確かめてください。更新の `--attendee` は出席者を**置き換えます**(足すのではありません)
1013
+ - `twp onedrive item upload` は 250MB までのファイルを 10MB ずつに分けて送ります。**同じ名前のファイルがあっても上書きせず**、Microsoft 365 が名前を変えて保存します(付いた名前は結果の `name` に出ます)。ファイルは CLI が直接読み、シェルを通しません
1014
+ - `twp onedrive link create` は `--scope`(`organization`=組織内/`anonymous`=リンクを知る誰でも)を必ず指定し、`--yes` が必要です。**作ったリンクはこの CLI からは消せません**(OneDrive の「アクセス許可の管理」から外します)。OneDrive のファイルの削除もこの CLI からはできません
988
1015
  - `twp teams message list` のチャネルで返るのはスレッドの最初の投稿だけです。返信は `twp teams reply list <投稿ID>` で読みます
989
1016
  - `twp onedrive` の `--drive` を省くと自分の OneDrive が対象です(そのことを表示します)。Teams のチャネルのファイルは `twp teams channel folder` の `driveId` を `--drive` に渡します
990
1017
  - ダウンロードは **`--out` のパスへ実体をそのまま書き出し**、既存ファイルは `--force` を付けたときだけ上書きします。添付・ファイルの名前から書き出し先を組み立てることはしません
@@ -1,6 +1,6 @@
1
1
  import { createRequire as __twpCreateRequire } from 'node:module';
2
2
  const require = __twpCreateRequire(import.meta.url);
3
- import{stepToItem}from"./chunk-L25UV7DE.js";import{loadLocalConfig}from"./chunk-QVPU4HHG.js";import"./chunk-N2UVRM3Z.js";import{loadAiConfig}from"./chunk-AEJHDFXB.js";import"./chunk-G2THOTBW.js";import"./chunk-GY7KI5E5.js";import"./chunk-II5RVJQN.js";import{LIST_FLAGS,LIST_PAGING_HELP,envelopePaging,nonEmpty,positiveInteger}from"./chunk-IOGMOXYF.js";import{requireResolved,singleRef,withResolved}from"./chunk-LXIAOCUW.js";import{acknowledgement,
3
+ import{stepToItem}from"./chunk-LUQ2KE6Y.js";import{loadLocalConfig}from"./chunk-QVPU4HHG.js";import"./chunk-N2UVRM3Z.js";import{loadAiConfig}from"./chunk-AEJHDFXB.js";import"./chunk-JTJWDV5U.js";import"./chunk-GY7KI5E5.js";import"./chunk-II5RVJQN.js";import{LIST_FLAGS,LIST_PAGING_HELP,envelopePaging,nonEmpty,positiveInteger}from"./chunk-IOGMOXYF.js";import{requireResolved,singleRef,withResolved}from"./chunk-LXIAOCUW.js";import{acknowledgement,
4
4
  isRecord,pick}from"./chunk-VTQAI52S.js";import{ApiResponseError,UsageError}from"./chunk-UFND7FBC.js";import"./chunk-PMOUHEJQ.js";import"./chunk-J7QYPKVK.js";import"./chunk-5WGOHFAS.js";import"./chunk-RZVI6PMW.js";import"./chunk-NHYMHCAT.js";import"./chunk-VSJBJXZO.js";var LABEL="\u30A8\u30FC\u30B8\u30A7\u30F3\u30C8\u30EB\u30FC\u30D7\u306E\u30A2\u30A4\u30C6\u30E0";var STATUSES=["pending","processing","completed","failed"];var AI_TYPES=["claude","gemini","codex","copilot"];var EFFORTS=["low","medium","high","xhigh","max"];var PRIORITIES=["P0","P1","P2","P3"];var LIST_COLUMNS=["item_id","status","task_key","label","ai_type","ai_effort","runner_id","created_at"];var GET_COLUMNS=["item_id","status","task_key","label","prompt","ai_type","ai_model","ai_effort","runn\
5
5
  er_id","attempt_count","reclaim_count","error_message","created_by_name","created_at","started_at","completed_at"];var HISTORY_COLUMNS=["item_id","status","task_key","skill","ai_type","runner_id","duration_ms","cost_usd","created_at"];var PROJECT_FLAG={name:"--project",summary:"\u30AD\u30E5\u30FC\u306E\u30D7\u30ED\u30B8\u30A7\u30AF\u30C8\uFF08\u30B3\u30FC\u30C9\u307E\u305F\u306F ID\u3002\u7701\u7565\u6642\u306F TWP_PROJECT / .twp/config.json / ~/.twp/config.json\uFF09",takesValue:true,placeholder:"\
6
6
  <\u30B3\u30FC\u30C9|ID>"};var ITEM_FLAG={name:"--item",summary:"\u30A2\u30A4\u30C6\u30E0\u306E ID\uFF08item_id\uFF09\u3002\u4F4D\u7F6E\u5F15\u6570\u3068\u540C\u3058\u610F\u5473\uFF08\u4E21\u65B9\u6307\u5B9A\u306F\u30A8\u30E9\u30FC\uFF09",takesValue:true,placeholder:"<\u30A2\u30A4\u30C6\u30E0ID>"};var FORBIDDEN_CORE="\u30C6\u30CA\u30F3\u30C8\u306E\u7BA1\u7406\u8005\uFF08admin \u30ED\u30FC\u30EB\uFF09\u306E\u6A29\u9650\u304C\u5FC5\u8981\u3067\u3059\uFF08\u500B\u4EBA\u30AD\u30E5\u30FC\u3092\u9664\u304F\uFF09";
@@ -1,7 +1,7 @@
1
1
  import { createRequire as __twpCreateRequire } from 'node:module';
2
2
  const require = __twpCreateRequire(import.meta.url);
3
- import{failureHint,isAuthError,isCliFatalText,isRateLimited,isServerAiType,isUntrusted,maxTurnsReached,rateLimitWaitSeconds,tailForScan}from"./chunk-ZOOEH7ZE.js";import{detectAiClis}from"./chunk-T4QZO6RQ.js";import{expandServerSkills,prepareSkillOverlay}from"./chunk-AITUMFCH.js";import"./chunk-H3WYVFTS.js";import"./chunk-AJO4O5ZF.js";import"./chunk-VRBI2NPI.js";import{isForceOnly,killProcessTree,system32}from"./chunk-N2UVRM3Z.js";import{DEFAULT_CLAUDE_LAUNCHER,
4
- activeSlotPath,detectClaudeAutoSwitch,isClaudeAi,isUsableModelId,modelFitsRoute,resolveSpawnTarget,usesBedrock,wrapWithAutoSwitch}from"./chunk-AEJHDFXB.js";import"./chunk-G2THOTBW.js";import"./chunk-GY7KI5E5.js";import"./chunk-UFND7FBC.js";import{findExecutable,isWindowsDriveAbsolute}from"./chunk-PMOUHEJQ.js";import"./chunk-J7QYPKVK.js";import"./chunk-5WGOHFAS.js";import{stripTerminalControls}from"./chunk-NHYMHCAT.js";import"./chunk-VSJBJXZO.js";import{spawnSync}from"child_process";import fs2 from"fs";import path2 from"path";import{spawn}from"child_process";import fs from"fs";import path from"path";var FINAL_REPORT_BEGIN="<<<AI_FINAL_REPORT>>>";var FINAL_REPORT_END="<<<END_AI_FINAL_REPORT>>>";var ClaudeStreamRenderer=class{constructor(now=()=>new Date){this.now=now}now;toolNames=new Map;toolCount=0;result={subtype:null,isError:null,numTurns:null,costUsd:null,durationMs:null,tokensIn:null,tokensOut:null,rateLimited:false,resetsAt:null,finalText:""};push(line){const trimmed=line.trim();if(trimmed==="")return[];let event;try{const parsed=JSON.parse(trimmed);if(parsed===null||typeof parsed!=="\
3
+ import{failureHint,isAuthError,isCliFatalText,isRateLimited,isServerAiType,isUntrusted,maxTurnsReached,rateLimitWaitSeconds,tailForScan}from"./chunk-ZOOEH7ZE.js";import{detectAiClis}from"./chunk-T4QZO6RQ.js";import{expandServerSkills,prepareSkillOverlay}from"./chunk-TKGVAWGU.js";import"./chunk-H3WYVFTS.js";import"./chunk-AJO4O5ZF.js";import"./chunk-VRBI2NPI.js";import{isForceOnly,killProcessTree,system32}from"./chunk-N2UVRM3Z.js";import{DEFAULT_CLAUDE_LAUNCHER,
4
+ activeSlotPath,detectClaudeAutoSwitch,isClaudeAi,isUsableModelId,modelFitsRoute,resolveSpawnTarget,usesBedrock,wrapWithAutoSwitch}from"./chunk-AEJHDFXB.js";import"./chunk-JTJWDV5U.js";import"./chunk-GY7KI5E5.js";import"./chunk-UFND7FBC.js";import{findExecutable,isWindowsDriveAbsolute}from"./chunk-PMOUHEJQ.js";import"./chunk-J7QYPKVK.js";import"./chunk-5WGOHFAS.js";import{stripTerminalControls}from"./chunk-NHYMHCAT.js";import"./chunk-VSJBJXZO.js";import{spawnSync}from"child_process";import fs2 from"fs";import path2 from"path";import{spawn}from"child_process";import fs from"fs";import path from"path";var FINAL_REPORT_BEGIN="<<<AI_FINAL_REPORT>>>";var FINAL_REPORT_END="<<<END_AI_FINAL_REPORT>>>";var ClaudeStreamRenderer=class{constructor(now=()=>new Date){this.now=now}now;toolNames=new Map;toolCount=0;result={subtype:null,isError:null,numTurns:null,costUsd:null,durationMs:null,tokensIn:null,tokensOut:null,rateLimited:false,resetsAt:null,finalText:""};push(line){const trimmed=line.trim();if(trimmed==="")return[];let event;try{const parsed=JSON.parse(trimmed);if(parsed===null||typeof parsed!=="\
5
5
  object"||Array.isArray(parsed)){return[line]}event=parsed}catch{return[line]}switch(event["type"]){case"rate_limit_event":return this.onRateLimit(event);case"assistant":return this.onAssistant(event);case"user":return this.onUser(event);case"result":return this.onResult(event);default:return event["type"]==="system"?[]:[line]}}sawRateLimit(){return this.result.rateLimited}lastRateLimitNote="";onRateLimit(event){const info=event["rate_limit_info"];if(info===null||typeof info!=="object")return[];const rec=info;
6
6
  const status=typeof rec["status"]==="string"?rec["status"]:"";const resets=typeof rec["resetsAt"]==="number"?rec["resetsAt"]:null;if(status==="")return[];const at=isSaneEpochSec(resets)?` resets=${new Date(resets*1e3).toISOString()}`:"";if(status.startsWith("allowed")){if(status==="allowed")return[];const seen=`${status}|${resets??""}`;if(seen===this.lastRateLimitNote)return[];this.lastRateLimitNote=seen;return[this.line(`\u2139\uFE0F \u4E0A\u9650\u306B\u63A5\u8FD1\uFF08status=${status}${at}\uFF09\u2014 \u5B9F\
7
7
  \u884C\u306F\u7D99\u7D9A\u3057\u307E\u3059`)]}if(resets!==null)this.result.resetsAt=resets;this.result.rateLimited=true;return[this.line(`\u26A0\uFE0F \u30EC\u30FC\u30C8\u30EA\u30DF\u30C3\u30C8\u901A\u77E5: status=${status}${at}`)]}onAssistant(event){const out=[];for(const block of contentBlocks(event)){if(block.type==="tool_use"){const name=typeof block.name==="string"?block.name:"tool";if(typeof block.id==="string")this.toolNames.set(block.id,name);this.toolCount+=1;out.push(this.line(`>> ${name}${toolDetail(
@@ -1,7 +1,7 @@
1
1
  import { createRequire as __twpCreateRequire } from 'node:module';
2
2
  const require = __twpCreateRequire(import.meta.url);
3
- import{CommandModelMissingError,MAX_REPORTED_VIOLATIONS,loadCommandModelDomain,loadCommandModelRoutes,validateBody,validateQuery}from"./chunk-NZ7WI4RZ.js";import{NO_REDACT_FLAG,NO_REDACT_NOTICE,exitCodeFor,fetchAllPages,reportError}from"./chunk-EM3SDCCU.js";import"./chunk-C2MQANJO.js";import{evaluateQuery}from"./chunk-ATYA6DG5.js";import{renderOutput}from"./chunk-Y4SREWAG.js";import{redactSecretValues,redactSecrets,withDebug}from"./chunk-IOCNJMVW.js";import"./chunk-Q3B65OFC.js";
4
- import{readBody}from"./chunk-ORUDW52G.js";import"./chunk-D5FEOBB6.js";import"./chunk-GMBJTG6A.js";import"./chunk-3HH5IYNO.js";import{parseOperationArgs,repeatedValues}from"./chunk-F7K37QG6.js";import{ApiError,TwpApiClient,appendQuery}from"./chunk-IF2K4PM5.js";import{GLOBAL_OPTIONS_HELP}from"./chunk-YLM54X35.js";import{AuthSession,NotLoggedInError,SessionExpiredError,loadCredentials}from"./chunk-XNLIEUAW.js";import{effectiveApiUrl,resolveConfiguredOutput,
3
+ import{CommandModelMissingError,MAX_REPORTED_VIOLATIONS,loadCommandModelDomain,loadCommandModelRoutes,validateBody,validateQuery}from"./chunk-NZ7WI4RZ.js";import{NO_REDACT_FLAG,NO_REDACT_NOTICE,exitCodeFor,fetchAllPages,reportError}from"./chunk-LLOXVVFK.js";import"./chunk-WPY6OQOT.js";import{evaluateQuery}from"./chunk-ATYA6DG5.js";import{renderOutput}from"./chunk-MXKAEPXA.js";import{redactSecretValues,redactSecrets,withDebug}from"./chunk-AUAZP2G7.js";import"./chunk-Q3B65OFC.js";
4
+ import{readBody}from"./chunk-ORUDW52G.js";import"./chunk-XWW63XJJ.js";import"./chunk-GMBJTG6A.js";import"./chunk-3HH5IYNO.js";import{parseOperationArgs,repeatedValues}from"./chunk-F7K37QG6.js";import{ApiError,TwpApiClient,appendQuery}from"./chunk-IF2K4PM5.js";import{GLOBAL_OPTIONS_HELP}from"./chunk-YLM54X35.js";import{AuthSession,NotLoggedInError,SessionExpiredError,loadCredentials}from"./chunk-XNLIEUAW.js";import{effectiveApiUrl,resolveConfiguredOutput,
5
5
  resolveProfile}from"./chunk-4VZKNEVN.js";import{HELP_TOKEN}from"./chunk-Y5EN7RYN.js";import"./chunk-QQRJLH6B.js";import{OUTPUT_FORMATS,resolveOutputFormat}from"./chunk-K2ONOH3L.js";import"./chunk-WVS4W5FY.js";import"./chunk-II5RVJQN.js";import{DEFAULT_MAX_ITEMS,DEFAULT_MAX_PAGES,envelopePaging,isPageNumberEnvelope,pageRangeNotes,positiveInteger,readEnvelopeCursor,readPageNumberCursor,shellQuote}from"./chunk-IOGMOXYF.js";import"./chunk-VTQAI52S.js";
6
6
  import{ApiRejectedError,ApiResponseError,EXIT_OK,EXIT_WAIT_TIMEOUT,NetworkError,UsageError}from"./chunk-UFND7FBC.js";import{httpFetch}from"./chunk-J7QYPKVK.js";import"./chunk-RZVI6PMW.js";import{stripTerminalControls}from"./chunk-NHYMHCAT.js";import"./chunk-VSJBJXZO.js";var MIN_SEGMENT_CHARS=3;var parsedCache=new WeakMap;function splitSegments(path){return path.split("/").filter(segment=>segment!=="")}function parseRoutes(routes){const cached=parsedCache.get(routes);if(cached!==void 0)return cached;const parsed=[];for(const[key,domain]of Object.entries(routes.routes)){const space=key.indexOf(" ");if(space<=0)continue;const template=key.slice(space+1);parsed.push({method:key.slice(0,space),template,domain,segments:splitSegments(template).map(segment=>/^\{[^/{}]+\}$/.
7
7
  test(segment)?null:segment)})}parsedCache.set(routes,parsed);return parsed}function matches(route,segments){if(route.segments.length!==segments.length)return false;return route.segments.every((literal,i)=>literal===null||literal===segments[i])}function compareSpecificity(a,b){const literals=route=>route.segments.filter(segment=>segment!==null).length;const diff=literals(b)-literals(a);if(diff!==0)return diff;for(let i=0;i<a.segments.length;i+=1){const aLiteral=a.segments[i]!==null;const bLiteral=b.
@@ -1,7 +1,7 @@
1
1
  import { createRequire as __twpCreateRequire } from 'node:module';
2
2
  const require = __twpCreateRequire(import.meta.url);
3
- import{RESIDENT_TOKEN_CAP,activateModeFiles,activatePermissionSettings,buildResidentSet,buildSystemPrompt,createAuditLogger,createTwpToolkit,currentBranch,describeAuditLog,describeToolCatalog,displayCwd,executeTool,findProjectTwpSubdir,localTools,lstatOrNull,parseFrontMatter,parseRule,persistProjectAllow,projectPermissionsPath,projectRootFor,readFileTool,residentInputs,resolveGitExecutable,runTurn,secretReason}from"./chunk-DVKPGJMS.js";import"./chunk-NZ7WI4RZ.js";import{buildDiffLines,
4
- diffStat}from"./chunk-VRBI2NPI.js";import"./chunk-IOCNJMVW.js";import{require_fuzzysort}from"./chunk-DIMZRTLE.js";import"./chunk-D5FEOBB6.js";import"./chunk-GMBJTG6A.js";import"./chunk-3HH5IYNO.js";import"./chunk-IF2K4PM5.js";import{RelayError,builtinCatalog,createRuntime,loadCachedCatalog,modelLabel,pickModel,toModelInfos}from"./chunk-6QOT7CHX.js";import"./chunk-D233KKXW.js";import"./chunk-XNLIEUAW.js";import{checkMinSupportedVersion,isBelowMinSupported,
3
+ import{RESIDENT_TOKEN_CAP,activateModeFiles,activatePermissionSettings,buildResidentSet,buildSystemPrompt,createAuditLogger,createTwpToolkit,currentBranch,describeAuditLog,describeToolCatalog,displayCwd,executeTool,findProjectTwpSubdir,localTools,lstatOrNull,parseFrontMatter,parseRule,persistProjectAllow,projectPermissionsPath,projectRootFor,readFileTool,residentInputs,resolveGitExecutable,runTurn,secretReason}from"./chunk-LKS7GANP.js";import"./chunk-NZ7WI4RZ.js";import{buildDiffLines,
4
+ diffStat}from"./chunk-VRBI2NPI.js";import"./chunk-AUAZP2G7.js";import{require_fuzzysort}from"./chunk-DIMZRTLE.js";import"./chunk-XWW63XJJ.js";import"./chunk-GMBJTG6A.js";import"./chunk-3HH5IYNO.js";import"./chunk-IF2K4PM5.js";import{RelayError,builtinCatalog,createRuntime,loadCachedCatalog,modelLabel,pickModel,toModelInfos}from"./chunk-6QOT7CHX.js";import"./chunk-D233KKXW.js";import"./chunk-XNLIEUAW.js";import{checkMinSupportedVersion,isBelowMinSupported,
5
5
  minSupportedBlockMessage}from"./chunk-DXXFUNYN.js";import"./chunk-4VZKNEVN.js";import{parseArgv}from"./chunk-4OSCQLZT.js";import{applyPermissionMode,checkPermission,describePermissionMode,getMode,isModeId,modeSource,nextMode}from"./chunk-NAUH75MM.js";import"./chunk-Y5EN7RYN.js";import"./chunk-QQRJLH6B.js";import{isFullWidth,isWide,stringWidth,stripAnsi}from"./chunk-WVS4W5FY.js";import"./chunk-N2UVRM3Z.js";import"./chunk-II5RVJQN.js";import"./chunk-UFND7FBC.js";
6
6
  import"./chunk-PMOUHEJQ.js";import{proxyDiagnostics}from"./chunk-J7QYPKVK.js";import{configReadDirs,twpHomeDir}from"./chunk-RZVI6PMW.js";import{stripTerminalControls}from"./chunk-NHYMHCAT.js";import{__commonJS,__export,__require,__toESM}from"./chunk-VSJBJXZO.js";var require_react_production=__commonJS({"node_modules/react/cjs/react.production.js"(exports){"use strict";var REACT_ELEMENT_TYPE=Symbol.for("react.transitional.element");var REACT_PORTAL_TYPE=Symbol.for("react.portal");var REACT_FRAGMENT_TYPE=Symbol.for("react.fragment");var REACT_STRICT_MODE_TYPE=Symbol.for("react.strict_mode");var REACT_PROFILER_TYPE=Symbol.for("react.profiler");var REACT_CONSUMER_TYPE=Symbol.for("react.consumer");var REACT_CONTEXT_TYPE=Symbol.for("react.context");var REACT_FORWARD_REF_TYPE=Symbol.
7
7
  for("react.forward_ref");var REACT_SUSPENSE_TYPE=Symbol.for("react.suspense");var REACT_MEMO_TYPE=Symbol.for("react.memo");var REACT_LAZY_TYPE=Symbol.for("react.lazy");var REACT_ACTIVITY_TYPE=Symbol.for("react.activity");var REACT_VIEW_TRANSITION_TYPE=Symbol.for("react.view_transition");var MAYBE_ITERATOR_SYMBOL=Symbol.iterator;function getIteratorFn(maybeIterable){if(null===maybeIterable||"object"!==typeof maybeIterable)return null;maybeIterable=MAYBE_ITERATOR_SYMBOL&&maybeIterable[MAYBE_ITERATOR_SYMBOL]||
@@ -1212,7 +1212,7 @@ cwd()){const listed=await gitListFiles(cwd2);const raw=listed??await walkFiles(c
1212
1212
  1;const after=/^[^\s]*/.exec(text.slice(cursor))?.[0]??"";return{query,start,end:cursor+after.length}}var TWP_SLASH_ROUTES={"/tasks":{domain:"task",operation:"list"},"/task":{domain:"task",operation:"get"},"/projects":{domain:"project",operation:"list"}};function isTwpSlashCommand(name){return Object.hasOwn(TWP_SLASH_ROUTES,name)}async function runTwpSlashCommand(name,args,deps){const route=TWP_SLASH_ROUTES[name];if(!Object.hasOwn(TWP_SLASH_ROUTES,name)||route===void 0){return{code:2,out:"",err:`\u4E0D\u660E\u306A\u30B3\u30DE\u30F3\u30C9: ${name}
1213
1213
  `}}const parsed=parseArgv([route.domain,route.operation,...args]);if(parsed.command!=="domain"||parsed.domain!==route.domain){return{code:2,out:"",err:`${name}: \u3053\u306E\u5F15\u6570\u306F\u4F7F\u3048\u307E\u305B\u3093\uFF08${args.join(" ")}\uFF09
1214
1214
  `}}if(parsed.unknown.length>0){return{code:2,out:"",err:`\u4E0D\u660E\u306A\u5F15\u6570: ${parsed.unknown.join(" ")}
1215
- `}}let out="";let err="";const io={out:text=>void(out+=text),err:text=>void(err+=text),isTty:true};const globals={profile:parsed.profile??deps.profile,...parsed.output!==void 0?{output:parsed.output}:{},...parsed.query!==void 0?{query:parsed.query}:{},dryRun:parsed.dryRun,debug:parsed.debug,yes:parsed.yes,refresh:parsed.refresh};const{runDomain}=await import("./run-NVS532DL.js");try{const code=await runDomain({domain:route.domain,...parsed.operation!==void 0?{operation:parsed.operation}:
1215
+ `}}let out="";let err="";const io={out:text=>void(out+=text),err:text=>void(err+=text),isTty:true};const globals={profile:parsed.profile??deps.profile,...parsed.output!==void 0?{output:parsed.output}:{},...parsed.query!==void 0?{query:parsed.query}:{},dryRun:parsed.dryRun,debug:parsed.debug,yes:parsed.yes,refresh:parsed.refresh};const{runDomain}=await import("./run-VGH3UT6R.js");try{const code=await runDomain({domain:route.domain,...parsed.operation!==void 0?{operation:parsed.operation}:
1216
1216
  {},argv:parsed.domainArgv,help:parsed.domainHelp,globals,version:deps.version,io,...deps.fetchImpl!==void 0?{fetchImpl:deps.fetchImpl}:{}});return{code,out,err}}catch(e){return{code:1,out,err:`${err}${e.message}
1217
1217
  `}}}var GIT_LOG_OUTPUT=["9f3c1a2 feat(ui): \u4E00\u89A7\u306E\u30D5\u30A3\u30EB\u30BF\u3092 URL \u30AF\u30A8\u30EA\u3068\u540C\u671F\u3059\u308B","4b8e0d7 fix(ui): \u4EEE\u60F3\u30B9\u30AF\u30ED\u30FC\u30EB\u306E\u884C\u9AD8\u3055\u3092\u5B9F\u6E2C\u5024\u306B\u5408\u308F\u305B\u308B","c15a99e refactor(api): \u4E00\u89A7\u53D6\u5F97\u306E\u30DA\u30FC\u30B8\u30F3\u30B0\u51E6\u7406\u3092\u5171\u901A\u5316\u3059\u308B","2d70f4b test: \u4E00\u89A7\u30D5\u30A3\u30EB\u30BF\u306E\u56DE\u5E30\u30C6\u30B9\u30C8\u3092\u8FFD\u52A0\u3059\u308B",
1218
1218
  "a6e2b38 fix(api): \u7A7A\u306E\u691C\u7D22\u6761\u4EF6\u3067\u5168\u4EF6\u8FD4\u3089\u306A\u3044\u3088\u3046\u306B\u3059\u308B","7c40d51 chore(deps): \u958B\u767A\u4F9D\u5B58\u3092\u6700\u65B0\u3078\u66F4\u65B0\u3059\u308B","e83b1c6 docs: \u30BB\u30C3\u30C8\u30A2\u30C3\u30D7\u624B\u9806\u306B Node 22 \u306E\u524D\u63D0\u3092\u8FFD\u8A18\u3059\u308B","b91f7a4 fix(ui): \u30E2\u30FC\u30C0\u30EB\u306E\u91CD\u306A\u308A\u9806\u3092\u6307\u5B9A\u3059\u308B","5a2c8e0 perf(api): \u4E00\u89A7\u306E N+1 \u3092\u89E3\u6D88\u3059\u308B",
@@ -1,6 +1,6 @@
1
1
  import { createRequire as __twpCreateRequire } from 'node:module';
2
2
  const require = __twpCreateRequire(import.meta.url);
3
- import{readBody}from"./chunk-ORUDW52G.js";import{BACKLOG_BASE_PATH,BACKLOG_PROJECT_SCOPE_LABEL,BACKLOG_SCOPE_LABEL,backlogSpacePath,isExactNumericId,resolveNamed}from"./chunk-D5FEOBB6.js";import"./chunk-GMBJTG6A.js";import"./chunk-3HH5IYNO.js";import"./chunk-IF2K4PM5.js";import"./chunk-4VZKNEVN.js";import"./chunk-II5RVJQN.js";import{requireResolved,singleRef,withResolved}from"./chunk-LXIAOCUW.js";import{isRecord,pick}from"./chunk-VTQAI52S.js";
3
+ import{readBody}from"./chunk-ORUDW52G.js";import{BACKLOG_BASE_PATH,BACKLOG_PROJECT_SCOPE_LABEL,BACKLOG_SCOPE_LABEL,backlogSpacePath,isExactNumericId,resolveNamed}from"./chunk-XWW63XJJ.js";import"./chunk-GMBJTG6A.js";import"./chunk-3HH5IYNO.js";import"./chunk-IF2K4PM5.js";import"./chunk-4VZKNEVN.js";import"./chunk-II5RVJQN.js";import{requireResolved,singleRef,withResolved}from"./chunk-LXIAOCUW.js";import{isRecord,pick}from"./chunk-VTQAI52S.js";
4
4
  import{ApiResponseError,UsageError}from"./chunk-UFND7FBC.js";import"./chunk-J7QYPKVK.js";import"./chunk-RZVI6PMW.js";import"./chunk-NHYMHCAT.js";import"./chunk-VSJBJXZO.js";var DEFAULT_COUNT=20;var MAX_COUNT=100;var NUMERIC=/^[0-9]+$/;var ISSUE_REF=/^(?:[A-Za-z0-9_]+-[0-9]+|[0-9]+)$/;var DATE=/^[0-9]{4}-[0-9]{2}-[0-9]{2}$/;var SPACE_COLUMNS=["id","space_url"];var PROJECT_COLUMNS=["id","projectKey","name"];var ISSUE_LIST_COLUMNS=["issueKey","summary","status","assignee","priority","dueDate","updated","descriptionTruncated"];var ISSUE_GET_COLUMNS=["id","issueKey","projectId","summary","description","descriptionTruncated","status","issueType","priority","assignee","cr\
5
5
  eatedUser","parentIssueId","startDate","dueDate","estimatedHours","actualHours","created","updated"];var COMMENT_COLUMNS=["id","created","createdUserId","createdUser","content","changeLog"];function commentRow(row){const source=isRecord(row)?row:{};const user=isRecord(source["createdUser"])?source["createdUser"]:{};return pick({...source,createdUserId:user["id"]??null,createdUser:user["name"]??null},COMMENT_COLUMNS)}var ATTACHMENT_COLUMNS=["id","name","size","contentType","createdUserId","create\
6
6
  dUser","created"];var STATUS_COLUMNS=["id","name","color"];var USER_COLUMNS=["id","userId","name","mailAddress","roleType"];var SPACE_FLAG={name:"--space",summary:"Backlog \u30B9\u30DA\u30FC\u30B9\uFF08ID / \u30B9\u30DA\u30FC\u30B9URL / \u30B5\u30D6\u30C9\u30E1\u30A4\u30F3\uFF09\u3002\u767B\u9332\u304C1\u4EF6\u306A\u3089\u7701\u7565\u3067\u304D\u307E\u3059",takesValue:true,placeholder:"<ID|URL>"};var BODY_MAX_CHARS=1e5;var BODY_FLAGS=[{name:"--body-file",summary:"\u672C\u6587\u3092\u30D5\u30A1\u30A4\u30EB\u304B\u3089\u8AAD\u3080\uFF08- \u3067\u6A19\u6E96\u5165\u529B\uFF09\u3002\u6539\u884C\u30FBMarkdown\
@@ -0,0 +1,64 @@
1
+ import { createRequire as __twpCreateRequire } from 'node:module';
2
+ const require = __twpCreateRequire(import.meta.url);
3
+ import{JsonBodyWithView}from"./chunk-Q3B65OFC.js";import{emailText,ms365Forbidden,recipientsText,str}from"./chunk-QICH2OOI.js";import{readBody}from"./chunk-ORUDW52G.js";import{assertMs365PathSegment,ms365Path,ms365Segment}from"./chunk-3HH5IYNO.js";import{repeatedValues}from"./chunk-F7K37QG6.js";import{requireResolved,singleRef,withResolved}from"./chunk-LXIAOCUW.js";import{isRecord}from"./chunk-VTQAI52S.js";import{ApiResponseError,UsageError}from"./chunk-UFND7FBC.js";import fs from"fs";import path from"path";var BODY_MAX_CHARS=1e5;var ATTACH_TOTAL_MAX_BYTES=3*1024*1024;var ADDRESS=/^[^\s@,;<>"]+@[^\s@,;<>"]+$/;var INVISIBLE=/[\p{Cc}\p{Cf}]/u;function oneLine(value){return value.replace(/[\r\n\t]+/g," ").replace(/[\p{Cc}\p{Cf}]/gu,"")}var TO_FLAG={name:"--to",summary:"\u5B9B\u5148\u306E\u30E1\u30FC\u30EB\u30A2\u30C9\u30EC\u30B9\uFF08\u5FC5\u9808\u3002\u8907\u6570\u306A\u3089\u7E70\u308A\u8FD4\u3059\uFF09",takesValue:true,placeholder:"<\u30A2\u30C9\u30EC\u30B9>",repeatable:true};var CC_FLAG={name:"--c\
4
+ c",summary:"Cc \u306E\u30E1\u30FC\u30EB\u30A2\u30C9\u30EC\u30B9\uFF08\u8907\u6570\u306A\u3089\u7E70\u308A\u8FD4\u3059\uFF09",takesValue:true,placeholder:"<\u30A2\u30C9\u30EC\u30B9>",repeatable:true};var BODY_FILE_FLAG={name:"--body-file",summary:"\u672C\u6587\u3092\u30D5\u30A1\u30A4\u30EB\u304B\u3089\u8AAD\u3080\uFF08- \u3067\u6A19\u6E96\u5165\u529B\uFF09",takesValue:true,placeholder:"<\u30D1\u30B9|->"};var BODY_FLAG={name:"--body",summary:"\u672C\u6587\u3092\u76F4\u63A5\u6307\u5B9A\u3059\u308B\uFF08\u4E00\u884C\u5411\u3051\u3002--body-file \u3068\u306E\u4F75\u7528\u306F\u30A8\u30E9\u30FC\uFF09",
5
+ takesValue:true,placeholder:"<\u6587\u5B57\u5217>"};var HTML_FLAG={name:"--html",summary:"\u672C\u6587\u3092 HTML \u3068\u3057\u3066\u9001\u308B\uFF08\u65E2\u5B9A\u306F\u30C6\u30AD\u30B9\u30C8\uFF09",takesValue:false};var MESSAGE_FLAG={name:"--message",summary:"\u5143\u306E\u30E1\u30FC\u30EBID\uFF08\u4F4D\u7F6E\u5F15\u6570\u3068\u540C\u3058\u610F\u5473\uFF09",takesValue:true,placeholder:"<ID>"};var EXTERNAL_SEND_HELP="\u26A0 \u5916\u90E8\u3078\u51FA\u308B\u64CD\u4F5C\u3067\u3059\u3002\u5B9F\u884C\u3057\u305F\u77AC\u9593\u306B\u76F8\u624B\u306E\u53D7\u4FE1\u7BB1\u3078\u5C4A\u304D\u3001\u53D6\u308A\u6D88\u305B\u307E\u305B\u3093\u3002\n --yes \u304C\u7121\u3051\u308C\u3070\u5B9F\u884C\u3057\u307E\u305B\u3093\u3002--dry-run \u3067\u9001\u308B\u5185\u5BB9\uFF08\u5B9B\u5148\u30FB\u4EF6\
6
+ \u540D\u30FB\u672C\u6587\u30FB\u6DFB\u4ED8\u306E\u540D\u524D\u3068\u5927\u304D\u3055\uFF09\u3092\u78BA\u304B\u3081\u3066\u304B\u3089\n --yes \u3092\u4ED8\u3051\u3066\u304F\u3060\u3055\u3044\uFF08--dry-run \u306F --yes \u3092\u8981\u308A\u307E\u305B\u3093\uFF09\u3002\n\u26A0 \u7D42\u4E86\u30B3\u30FC\u30C9 4\uFF08\u901A\u4FE1\u306E\u5931\u6557\u30FB\u30B5\u30FC\u30D0\u306E\u4E00\u6642\u30A8\u30E9\u30FC\uFF09\u3067\u3082\u3001Microsoft 365 \u5074\u3067\u306F\u9001\u4FE1\u6E08\u307F\u306E\u3053\u3068\u304C\u3042\u308A\u307E\u3059\u3002\n \u6253\u3061\u76F4\u3059\u524D\u306B twp outlook mail list --folder sentitems \u3067\u9001\u4FE1\u6E08\u307F\u30A2\u30A4\u30C6\u30E0\u3092\u78BA\u8A8D\u3057\u3066\u304F\u3060\u3055\u3044\u3002";
7
+ var BODY_HELP="\u672C\u6587\u306F --body-file <\u30D1\u30B9>\uFF08- \u3067\u6A19\u6E96\u5165\u529B\uFF09\u304B --body <\u6587\u5B57\u5217> \u3067\u6E21\u3057\u307E\u3059\u3002\u6539\u884C\u3084\u8A18\u53F7\u3092\u542B\u3080\u672C\u6587\u306F\n--body-file \u3092\u4F7F\u3063\u3066\u304F\u3060\u3055\u3044\uFF08\u30B7\u30A7\u30EB\u306E\u5F15\u6570\u306B\u8F09\u305B\u308B\u3068\u58CA\u308C\u307E\u3059\uFF09\u3002";function addresses(input,flag){return repeatedValues(input,flag).map(raw=>{const value=raw.
8
+ trim();if(!ADDRESS.test(value)||INVISIBLE.test(value)){throw new UsageError(`${flag} \u306B\u306F\u30E1\u30FC\u30EB\u30A2\u30C9\u30EC\u30B9\u30921\u3064\u305A\u3064\u6307\u5B9A\u3057\u3066\u304F\u3060\u3055\u3044\uFF08\u53D7\u3051\u53D6\u3063\u305F\u5024: ${raw}\uFF09`,`\u540D\u524D\u304B\u3089\u306F\u5B9B\u5148\u3092\u63A2\u3057\u307E\u305B\u3093\u3002\u8907\u6570\u306E\u5B9B\u5148\u306F ${flag} \u3092\u7E70\u308A\u8FD4\u3057\u3066\u304F\u3060\u3055\u3044\uFF08\u4F8B: ${flag} a@example.com ${flag}\
9
+ b@example.com\uFF09\u3002`)}return value})}function recipients(list){return list.map(address=>({emailAddress:{address}}))}function textToHtml(text){return text.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/\t/g,"&nbsp;&nbsp;&nbsp;&nbsp;").replace(/ {2,}/g,run=>` ${"&nbsp;".repeat(run.length-1)}`).replace(/(^|\r\n|\r|\n) /g,"$1&nbsp;").replace(/\r\n|\r|\n/g,"<br>\n")}var CONTENT_TYPES={".pdf":"application/pdf",".csv":"text/csv",".txt":"text/plain",
10
+ ".md":"text/markdown",".json":"application/json",".xml":"application/xml",".html":"text/html",".png":"image/png",".jpg":"image/jpeg",".jpeg":"image/jpeg",".gif":"image/gif",".svg":"image/svg+xml",".zip":"application/zip",".xlsx":"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet",".docx":"application/vnd.openxmlformats-officedocument.wordprocessingml.document",".pptx":"application/vnd.openxmlformats-officedocument.presentationml.presentation",".xls":"application/vnd.ms-excel",".d\
11
+ oc":"application/msword",".ppt":"application/vnd.ms-powerpoint"};function readAttachments(input){const files=repeatedValues(input,"--attach");const opened=[];try{let total=0;for(const file of files){let fd;try{fd=fs.openSync(file,"r")}catch(err){const reason=err.code??err.message;throw new UsageError(`--attach \u306E\u30D5\u30A1\u30A4\u30EB\u3092\u8AAD\u3081\u307E\u305B\u3093: ${file}\uFF08${reason}\uFF09`)}const stat=fs.fstatSync(fd);opened.push({file,fd,size:stat.size});if(!stat.isFile())throw new UsageError(
12
+ `--attach \u306B\u901A\u5E38\u306E\u30D5\u30A1\u30A4\u30EB\u4EE5\u5916\u306F\u6307\u5B9A\u3067\u304D\u307E\u305B\u3093: ${file}`);total+=stat.size}if(total>ATTACH_TOTAL_MAX_BYTES)throw tooLarge(total);let read=0;const attachments=opened.map(({file,fd})=>{const bytes=fs.readFileSync(fd);read+=bytes.byteLength;const name=path.basename(file);const contentType=CONTENT_TYPES[path.extname(name).toLowerCase()];return{name,path:path.resolve(file),bytes:bytes.byteLength,contentBytes:bytes.toString("base6\
13
+ 4"),...contentType===void 0?{}:{contentType}}});if(read>ATTACH_TOTAL_MAX_BYTES)throw tooLarge(read);return attachments}finally{for(const{fd}of opened)fs.closeSync(fd)}}function tooLarge(total){return new UsageError(`\u6DFB\u4ED8\u306E\u5408\u8A08\u304C\u5927\u304D\u3059\u304E\u307E\u3059\uFF08${total} \u30D0\u30A4\u30C8\u30FB\u4E0A\u9650 ${ATTACH_TOTAL_MAX_BYTES} \u30D0\u30A4\u30C8\uFF09`,"Microsoft 365 \u306F\u30E1\u30FC\u30EB\u306B\u76F4\u63A5\u8F09\u305B\u308B\u6DFB\u4ED8\u3092 3MB \u672A\u6E80\u307E\u3067\u3068\u3057\u3066\u3044\u307E\u3059\u3002\u5927\u304D\u3044\u30D5\u30A1\u30A4\u30EB\u306F OneDrive \u306B\u7F6E\u3044\u3066\u5171\u6709\u30EA\u30F3\u30AF\u3092\u672C\u6587\u306B\u66F8\u3044\u3066\u304F\u3060\u3055\u3044\u3002")}
14
+ function assertSent(body,label){if(!isRecord(body)||body["result"]!==true){throw new ApiResponseError(`${label}\u306E\u5FDC\u7B54\u304C\u60F3\u5B9A\u306E\u5F62\u3067\u306F\u3042\u308A\u307E\u305B\u3093\uFF08result \u304C true \u3067\u306F\u306A\u3044\uFF09\u3002\u9001\u4FE1\u6E08\u307F\u30A2\u30A4\u30C6\u30E0\u3092\u78BA\u8A8D\u3057\u3066\u304F\u3060\u3055\u3044\u3002`)}return body}function sentSummary(body,label){assertSent(body,label);return{sent:true}}function resolvedJson(input,key){return JSON.
15
+ parse(requireResolved(input,key))}function bodySummary(text,html){if(text===void 0)return"\u672C\u6587: \u306A\u3057";return`\u672C\u6587: ${html?"HTML":"\u30C6\u30AD\u30B9\u30C8"} ${[...text].length} \u6587\u5B57`}function messageId(input,op){return assertMs365PathSegment(singleRef(input,{flag:"--message",label:"\u5143\u306E\u30E1\u30FC\u30EBID",usage:`twp outlook mail ${op} help`}),"\u5143\u306E\u30E1\u30FC\u30EBID")}function replyAudience(message,all){const replyTo=recipientsText(message["rep\
16
+ lyTo"]);const from=replyTo??emailText(message["from"])??"\uFF08\u5DEE\u51FA\u4EBA\u3092\u8AAD\u3081\u307E\u305B\u3093\uFF09";if(!all)return oneLine(`To ${from}`);const to=recipientsText(message["toRecipients"]);const cc=recipientsText(message["ccRecipients"]);return oneLine([`To ${from}${to===null?"":`\u3001${to}`}`,cc===null?null:`Cc ${cc}`].filter(v=>v!==null).join(" / ")+"\uFF08\u81EA\u5206\u81EA\u8EAB\u306F Microsoft 365 \u304C\u9664\u304D\u307E\u3059\uFF09")}var send={name:"send",summary:"\u30E1\
17
+ \u30FC\u30EB\u3092\u65B0\u3057\u304F\u9001\u308B\uFF08--yes \u304C\u5FC5\u8981\uFF09",usage:"twp outlook mail send --to <\u30A2\u30C9\u30EC\u30B9> [--to \u2026] [--cc <\u30A2\u30C9\u30EC\u30B9> \u2026] --subject <\u4EF6\u540D> (--body-file <\u30D1\u30B9> | --body <\u6587\u5B57\u5217>) [--html] [--attach <\u30D1\u30B9> \u2026] --yes",description:`${EXTERNAL_SEND_HELP}
18
+
19
+ \u5B9B\u5148\u306F --to / --cc \u306B\u30E1\u30FC\u30EB\u30A2\u30C9\u30EC\u30B9\u3067\u6307\u5B9A\u3057\u307E\u3059\uFF08\u540D\u524D\u304B\u3089\u306F\u63A2\u3057\u307E\u305B\u3093\uFF09\u3002\u8907\u6570\u306A\u3089\u30D5\u30E9\u30B0\u3092\u7E70\u308A\u8FD4\u3057\u307E\u3059\u3002
20
+ Bcc \u306F\u6307\u5B9A\u3067\u304D\u307E\u305B\u3093\uFF08Microsoft 365 \u306E\u4E2D\u7D99\u304C\u53D7\u3051\u4ED8\u3051\u306A\u3044\u305F\u3081\uFF09\u3002
21
+
22
+ ${BODY_HELP}
23
+ \u672C\u6587\u306F\u65E2\u5B9A\u3067\u30C6\u30AD\u30B9\u30C8\u3068\u3057\u3066\u9001\u308A\u307E\u3059\uFF08\u9014\u4E2D\u306E\u6539\u884C\u306F\u6B8B\u308A\u307E\u3059\u3002\u5148\u982D\u3068\u672B\u5C3E\u306E\u7A7A\u767D\u30FB\u6539\u884C\u306F\u30B5\u30FC\u30D0\u5074\u3067\u843D\u3061\u307E\u3059\uFF09\u3002
24
+ --html \u3092\u4ED8\u3051\u308B\u3068 HTML \u3068\u3057\u3066\u9001\u308A\u307E\u3059\u3002
25
+
26
+ --attach <\u30D1\u30B9> \u3067\u30D5\u30A1\u30A4\u30EB\u3092\u6DFB\u4ED8\u3067\u304D\u307E\u3059\uFF08\u7E70\u308A\u8FD4\u3057\u3066\u8907\u6570\uFF09\u3002\u5408\u8A08\u306F 3MB\uFF083,145,728 \u30D0\u30A4\u30C8\uFF09\u307E\u3067\u3067\u3059
27
+ \uFF08Microsoft 365 \u304C\u30E1\u30FC\u30EB\u306B\u76F4\u63A5\u8F09\u305B\u3089\u308C\u308B\u4E0A\u9650\uFF09\u3002\u76F8\u624B\u306B\u898B\u3048\u308B\u30D5\u30A1\u30A4\u30EB\u540D\u306F\u30D1\u30B9\u306E\u672B\u5C3E\u3060\u3051\u3067\u3059\u3002
28
+ --dry-run \u3067\u306F\u6DFB\u4ED8\u306E\u4E2D\u8EAB\u3092\u51FA\u3055\u305A\u3001\u540D\u524D\u3068\u5927\u304D\u3055\u3060\u3051\u3092\u8868\u793A\u3057\u307E\u3059\u3002
29
+
30
+ \u9001\u3063\u305F\u30E1\u30FC\u30EB\u306F\u9001\u4FE1\u6E08\u307F\u30A2\u30A4\u30C6\u30E0\u306B\u6B8B\u308A\u307E\u3059\uFF08twp outlook mail list --folder sentitems\uFF09\u3002`,destructive:true,confirmation:"\u5916\u90E8\u3078\u30E1\u30FC\u30EB\u3092\u9001\u308B\u64CD\u4F5C\uFF08\u53D6\u308A\u6D88\u305B\u307E\u305B\u3093\uFF09",flags:[TO_FLAG,CC_FLAG,{name:"--subject",summary:"\u4EF6\u540D\uFF08\u5FC5\u9808\uFF09",takesValue:true,placeholder:"<\u4EF6\u540D>"},BODY_FILE_FLAG,BODY_FLAG,HTML_FLAG,
31
+ {name:"--attach",summary:"\u6DFB\u4ED8\u3059\u308B\u30D5\u30A1\u30A4\u30EB\uFF08\u8907\u6570\u306A\u3089\u7E70\u308A\u8FD4\u3059\u30FB\u5408\u8A08 3MB \u307E\u3067\uFF09",takesValue:true,placeholder:"<\u30D1\u30B9>",repeatable:true}],forbidden:ms365Forbidden,async prepare(input){const usage="twp outlook mail send help";if(input.args.length>0)throw new UsageError(`\u4F4D\u7F6E\u5F15\u6570\u306F\u53D7\u3051\u4ED8\u3051\u307E\u305B\u3093: ${input.args.join(" ")}`,usage);const to=addresses(input,"--\
32
+ to");if(to.length===0)throw new UsageError("\u5B9B\u5148\uFF08--to\uFF09\u3092\u6307\u5B9A\u3057\u3066\u304F\u3060\u3055\u3044",usage);const cc=addresses(input,"--cc");const subject=input.flags.get("--subject");if(subject===void 0||subject.trim()==="")throw new UsageError("\u4EF6\u540D\uFF08--subject\uFF09\u3092\u6307\u5B9A\u3057\u3066\u304F\u3060\u3055\u3044",usage);const attachments=readAttachments(input);const body=await readBody(input,{flag:"--body",fileFlag:"--body-file",label:"\u30E1\u30FC\u30EB\u672C\u6587",
33
+ maxChars:BODY_MAX_CHARS,usage});if(body===void 0)throw new UsageError("\u672C\u6587\uFF08--body-file \u304B --body\uFF09\u3092\u6307\u5B9A\u3057\u3066\u304F\u3060\u3055\u3044",usage);return withResolved(input,{to:JSON.stringify(to),cc:JSON.stringify(cc),subject,body,attachments:JSON.stringify(attachments)})},plan(input){const to=resolvedJson(input,"to");const cc=resolvedJson(input,"cc");const attachments=resolvedJson(input,"attachments");const base={subject:requireResolved(input,"subject"),body:{
34
+ contentType:input.flags.has("--html")?"HTML":"Text",content:requireResolved(input,"body")},toRecipients:recipients(to),...cc.length>0?{ccRecipients:recipients(cc)}:{}};if(attachments.length===0)return{method:"POST",path:ms365Path("/outlook/sendMail"),body:base};const file=(a,contentBytes)=>({"@odata.type":"#microsoft.graph.fileAttachment",name:a.name,...a.contentType===void 0?{}:{contentType:a.contentType},contentBytes});return{method:"POST",path:ms365Path("/outlook/sendMail"),body:new JsonBodyWithView(
35
+ {...base,attachments:attachments.map(a=>file(a,a.contentBytes))},{...base,attachments:attachments.map(a=>file(a,`\uFF08base64\u30FB\u5143 ${a.bytes} \u30D0\u30A4\u30C8\u30FB\u8868\u793A\u3057\u306A\u3044\uFF09`))})}},plannedNotes(input){const to=resolvedJson(input,"to");const cc=resolvedJson(input,"cc");const attachments=resolvedJson(input,"attachments");return[`\u9001\u4FE1\u5185\u5BB9: To ${to.join("\u3001")}${cc.length>0?` / Cc ${cc.join("\u3001")}`:""} / \u4EF6\u540D\u300C${requireResolved(input,
36
+ "subject")}\u300D / ${bodySummary(requireResolved(input,"body"),input.flags.has("--html"))} / \u6DFB\u4ED8: ${attachments.length===0?"\u306A\u3057":attachments.map(a=>`${a.name}\uFF08${a.bytes} \u30D0\u30A4\u30C8\u30FB${a.path}\uFF09`).join("\u3001")}`]},summarize:body=>sentSummary(body,"\u30E1\u30FC\u30EB\u9001\u4FE1"),raw:body=>assertSent(body,"\u30E1\u30FC\u30EB\u9001\u4FE1"),notes:()=>["\u9001\u4FE1\u3057\u307E\u3057\u305F\u3002\u9001\u4FE1\u6E08\u307F\u30A2\u30A4\u30C6\u30E0\uFF08twp outlook mail list --folder sentitems\uFF09\u3067\u78BA\u8A8D\u3067\u304D\u307E\u3059\u3002"]};
37
+ function replyOperation(all){const op=all?"reply-all":"reply";const endpoint=all?"replyAll":"reply";const label=all?"\u5168\u54E1\u8FD4\u4FE1":"\u8FD4\u4FE1";return{name:op,summary:all?"\u30E1\u30FC\u30EB\u306B\u5168\u54E1\u8FD4\u4FE1\u3059\u308B\uFF08--yes \u304C\u5FC5\u8981\uFF09":"\u30E1\u30FC\u30EB\u306E\u5DEE\u51FA\u4EBA\u306B\u8FD4\u4FE1\u3059\u308B\uFF08--yes \u304C\u5FC5\u8981\uFF09",usage:`twp outlook mail ${op} <\u30E1\u30FC\u30EBID> (--body-file <\u30D1\u30B9> | --body <\u6587\u5B57\u5217>) [--html] --yes`,
38
+ description:`${EXTERNAL_SEND_HELP}
39
+
40
+ `+(all?"\u5143\u306E\u30E1\u30FC\u30EB\u306E\u5DEE\u51FA\u4EBA\u3068\u3001To\u30FBCc \u306E\u5168\u54E1\u306B\u8FD4\u4FE1\u3057\u307E\u3059\uFF08\u81EA\u5206\u81EA\u8EAB\u306F Microsoft 365 \u304C\u9664\u304D\u307E\u3059\uFF09\u3002\n":"\u5143\u306E\u30E1\u30FC\u30EB\u306E\u5DEE\u51FA\u4EBA\uFF08\u8FD4\u4FE1\u5148\u304C\u8A2D\u5B9A\u3055\u308C\u3066\u3044\u308C\u3070\u305D\u306E\u76F8\u624B\uFF09\u306B\u8FD4\u4FE1\u3057\u307E\u3059\u3002\n")+`\u5B9B\u5148\u306F Microsoft 365 \u304C\u5143\u306E\u30E1\u30FC\u30EB\u304B\u3089\u6C7A\u3081\u307E\u3059\u3002\u9001\u308B\u524D\u306B\u5143\u306E\u30E1\u30FC\u30EB\u3092\u8AAD\u307F\u3001\u5C4A\u304F\u76F8\u624B\u306E\u76EE\u5B89\u3092\u8868\
41
+ \u793A\u3057\u307E\u3059
42
+ \uFF08--dry-run \u3067\u3082\u8868\u793A\u3057\u307E\u3059\uFF09\u3002\u5B9B\u5148\u30FBCc \u3092\u8DB3\u3059\u3053\u3068\u3001\u6DFB\u4ED8\u3092\u4ED8\u3051\u308B\u3053\u3068\u306F\u3067\u304D\u307E\u305B\u3093\u3002
43
+ \u30E1\u30FC\u30EBID \u306F twp outlook mail list \u306E id \u3067\u3059\u3002
44
+
45
+ ${BODY_HELP}
46
+ \u672C\u6587\u306F\u5143\u306E\u30E1\u30FC\u30EB\u306E\u4E0A\u306B\u5DEE\u3057\u8FBC\u307E\u308C\u307E\u3059\u3002Microsoft 365 \u306F\u672C\u6587\u3092 HTML \u3068\u3057\u3066\u8AAD\u3080\u306E\u3067\u3001\u65E2\u5B9A\uFF08\u30C6\u30AD\u30B9\u30C8\uFF09\u3067\u306F
47
+ \u6539\u884C\u3068\u8A18\u53F7\u304C\u898B\u305F\u3068\u304A\u308A\u306B\u5C4A\u304F\u3088\u3046 HTML \u306B\u76F4\u3057\u3066\u9001\u308A\u307E\u3059\uFF08--dry-run \u306E body \u306B\u5909\u63DB\u5F8C\u306E\u5024\u304C\u51FA\u307E\u3059\uFF09\u3002
48
+ --html \u3092\u4ED8\u3051\u308B\u3068\u3001\u672C\u6587\u3092 HTML \u3068\u3057\u3066\u305D\u306E\u307E\u307E\u9001\u308A\u307E\u3059\u3002`,destructive:true,confirmation:"\u5916\u90E8\u3078\u30E1\u30FC\u30EB\u3092\u9001\u308B\u64CD\u4F5C\uFF08\u53D6\u308A\u6D88\u305B\u307E\u305B\u3093\uFF09",flags:[MESSAGE_FLAG,BODY_FILE_FLAG,BODY_FLAG,HTML_FLAG],forbidden:ms365Forbidden,async prepare(input,ctx){const usage=`twp outlook mail ${op} help`;const id=messageId(input,op);const body=await readBody(input,
49
+ {flag:"--body",fileFlag:"--body-file",label:`${label}\u306E\u672C\u6587`,maxChars:BODY_MAX_CHARS,usage});if(body===void 0)throw new UsageError("\u672C\u6587\uFF08--body-file \u304B --body\uFF09\u3092\u6307\u5B9A\u3057\u3066\u304F\u3060\u3055\u3044",usage);const original=await ctx.resolver.ms365Message(id);return withResolved(input,{messageId:id,body,audience:replyAudience(original,all),subject:oneLine(str(original["subject"])??"\uFF08\u4EF6\u540D\u306A\u3057\uFF09")})},plan(input){const body=requireResolved(
50
+ input,"body");const id=ms365Segment(requireResolved(input,"messageId"),"\u5143\u306E\u30E1\u30FC\u30EBID");return{method:"POST",path:ms365Path(`/outlook/messages/${id}/${endpoint}`),body:{comment:input.flags.has("--html")?body:textToHtml(body)}}},plannedNotes:input=>[`${label}\u306E\u5185\u5BB9: \u5143\u306E\u30E1\u30FC\u30EB\u300C${requireResolved(input,"subject")}\u300D / \u5C4A\u304F\u76F8\u624B\u306E\u76EE\u5B89\uFF08\u5143\u306E\u30E1\u30FC\u30EB\u304B\u3089 Microsoft 365 \u304C\u6C7A\u3081\u307E\u3059\uFF09: ${requireResolved(
51
+ input,"audience")} / ${bodySummary(requireResolved(input,"body"),input.flags.has("--html"))}`],summarize:body=>sentSummary(body,label),raw:body=>assertSent(body,label),notes:()=>[`${label}\u3057\u307E\u3057\u305F\u3002\u9001\u4FE1\u6E08\u307F\u30A2\u30A4\u30C6\u30E0\uFF08twp outlook mail list --folder sentitems\uFF09\u3067\u78BA\u8A8D\u3067\u304D\u307E\u3059\u3002`]}}var forward={name:"forward",summary:"\u30E1\u30FC\u30EB\u3092\u8EE2\u9001\u3059\u308B\uFF08--yes \u304C\u5FC5\u8981\uFF09",usage:"\
52
+ twp outlook mail forward <\u30E1\u30FC\u30EBID> --to <\u30A2\u30C9\u30EC\u30B9> [--to \u2026] [--body-file <\u30D1\u30B9> | --body <\u6587\u5B57\u5217>] [--html] --yes",description:`${EXTERNAL_SEND_HELP}
53
+
54
+ \u5143\u306E\u30E1\u30FC\u30EB\u3092\u3001\u6DFB\u4ED8\u3082\u542B\u3081\u3066 --to \u306E\u76F8\u624B\u3078\u8EE2\u9001\u3057\u307E\u3059\u3002\u5B9B\u5148\u306F\u30E1\u30FC\u30EB\u30A2\u30C9\u30EC\u30B9\u3067\u6307\u5B9A\u3057\u307E\u3059\uFF08\u540D\u524D\u304B\u3089\u306F\u63A2\u3057\u307E\u305B\u3093\uFF09\u3002
55
+ \u8907\u6570\u306A\u3089\u30D5\u30E9\u30B0\u3092\u7E70\u308A\u8FD4\u3057\u307E\u3059\u3002Cc\u30FBBcc \u306F\u6307\u5B9A\u3067\u304D\u307E\u305B\u3093\uFF08Microsoft 365 \u306E\u4E2D\u7D99\u304C\u53D7\u3051\u4ED8\u3051\u306A\u3044\u305F\u3081\uFF09\u3002
56
+ \u30E1\u30FC\u30EBID \u306F twp outlook mail list \u306E id \u3067\u3059\u3002
57
+
58
+ \u672C\u6587\uFF08\u6DFB\u3048\u66F8\u304D\uFF09\u306F\u4EFB\u610F\u3067\u3059\u3002${BODY_HELP}
59
+ \u672C\u6587\u306F\u5143\u306E\u30E1\u30FC\u30EB\u306E\u4E0A\u306B\u5DEE\u3057\u8FBC\u307E\u308C\u307E\u3059\u3002Microsoft 365 \u306F\u672C\u6587\u3092 HTML \u3068\u3057\u3066\u8AAD\u3080\u306E\u3067\u3001\u65E2\u5B9A\uFF08\u30C6\u30AD\u30B9\u30C8\uFF09\u3067\u306F
60
+ \u6539\u884C\u3068\u8A18\u53F7\u304C\u898B\u305F\u3068\u304A\u308A\u306B\u5C4A\u304F\u3088\u3046 HTML \u306B\u76F4\u3057\u3066\u9001\u308A\u307E\u3059\u3002--html \u3092\u4ED8\u3051\u308B\u3068\u3001\u672C\u6587\u3092 HTML \u3068\u3057\u3066\u305D\u306E\u307E\u307E\u9001\u308A\u307E\u3059\u3002`,destructive:true,confirmation:"\u5916\u90E8\u3078\u30E1\u30FC\u30EB\u3092\u9001\u308B\u64CD\u4F5C\uFF08\u53D6\u308A\u6D88\u305B\u307E\u305B\u3093\uFF09",flags:[MESSAGE_FLAG,TO_FLAG,BODY_FILE_FLAG,BODY_FLAG,
61
+ HTML_FLAG],forbidden:ms365Forbidden,async prepare(input){const usage="twp outlook mail forward help";const id=messageId(input,"forward");const to=addresses(input,"--to");if(to.length===0)throw new UsageError("\u8EE2\u9001\u5148\uFF08--to\uFF09\u3092\u6307\u5B9A\u3057\u3066\u304F\u3060\u3055\u3044",usage);if(input.flags.has("--html")&&!input.flags.has("--body")&&!input.flags.has("--body-file")){throw new UsageError("--html \u306F\u672C\u6587\uFF08--body-file \u304B --body\uFF09\u3068\u4E00\u7DD2\u306B\u6307\u5B9A\u3057\u3066\u304F\u3060\u3055\u3044",
62
+ usage)}const body=await readBody(input,{flag:"--body",fileFlag:"--body-file",label:"\u8EE2\u9001\u306E\u672C\u6587",maxChars:BODY_MAX_CHARS,usage});return withResolved(input,{messageId:id,to:JSON.stringify(to),...body===void 0?{}:{body}})},plan(input){const id=ms365Segment(requireResolved(input,"messageId"),"\u5143\u306E\u30E1\u30FC\u30EBID");const body=input.resolved?.["body"];return{method:"POST",path:ms365Path(`/outlook/messages/${id}/forward`),body:{...body===void 0?{}:{comment:input.flags.has(
63
+ "--html")?body:textToHtml(body)},toRecipients:recipients(resolvedJson(input,"to"))}}},plannedNotes:input=>[`\u8EE2\u9001\u306E\u5185\u5BB9: To ${resolvedJson(input,"to").join("\u3001")} / ${bodySummary(input.resolved?.["body"],input.flags.has("--html"))}\uFF08\u5143\u306E\u30E1\u30FC\u30EB\u3068\u6DFB\u4ED8\u306F\u305D\u306E\u307E\u307E\u4ED8\u304D\u307E\u3059\uFF09`],summarize:body=>sentSummary(body,"\u8EE2\u9001"),raw:body=>assertSent(body,"\u8EE2\u9001"),notes:()=>["\u8EE2\u9001\u3057\u307E\u3057\u305F\u3002\u9001\u4FE1\u6E08\u307F\u30A2\u30A4\u30C6\u30E0\uFF08twp outloo\
64
+ k mail list --folder sentitems\uFF09\u3067\u78BA\u8A8D\u3067\u304D\u307E\u3059\u3002"]};var mailSendOperations=[send,replyOperation(false),replyOperation(true),forward];export{textToHtml,mailSendOperations};
@@ -1,6 +1,6 @@
1
1
  import { createRequire as __twpCreateRequire } from 'node:module';
2
2
  const require = __twpCreateRequire(import.meta.url);
3
- import{booleanText,boundedText,isoDate}from"./chunk-XDHLO54T.js";import{ORG_MASTER_LIMIT}from"./chunk-D5FEOBB6.js";import{ULID_RE,UUID_RE,isSafePathSegment}from"./chunk-GMBJTG6A.js";import{nonEmpty,positiveInteger}from"./chunk-IOGMOXYF.js";import{requireResolved,singleRef,withResolved}from"./chunk-LXIAOCUW.js";import{acknowledgement,isRecord,pick}from"./chunk-VTQAI52S.js";import{ApiResponseError,UsageError}from"./chunk-UFND7FBC.js";var CLEAR_DATE="none";function placeholderOf(field){switch(field.kind){case"text":return`<${field.label}>`;case"integer":return"<\u6574\u6570>";case"boolean":return"<true|false>";case"enum":return`<${field.values.join("|")}>`;case"date":return`<YYYY-MM-DD|${CLEAR_DATE}>`;case"ref":return field.placeholder}}function createFlags(fields){return fields.map(field=>({name:field.flag,summary:field.summary,takesValue:true,placeholder:placeholderOf(field)}))}function updateFlags(fields){const flags=[];for(const field of fields){
3
+ import{booleanText,boundedText,isoDate}from"./chunk-XDHLO54T.js";import{ORG_MASTER_LIMIT}from"./chunk-XWW63XJJ.js";import{ULID_RE,UUID_RE,isSafePathSegment}from"./chunk-GMBJTG6A.js";import{nonEmpty,positiveInteger}from"./chunk-IOGMOXYF.js";import{requireResolved,singleRef,withResolved}from"./chunk-LXIAOCUW.js";import{acknowledgement,isRecord,pick}from"./chunk-VTQAI52S.js";import{ApiResponseError,UsageError}from"./chunk-UFND7FBC.js";var CLEAR_DATE="none";function placeholderOf(field){switch(field.kind){case"text":return`<${field.label}>`;case"integer":return"<\u6574\u6570>";case"boolean":return"<true|false>";case"enum":return`<${field.values.join("|")}>`;case"date":return`<YYYY-MM-DD|${CLEAR_DATE}>`;case"ref":return field.placeholder}}function createFlags(fields){return fields.map(field=>({name:field.flag,summary:field.summary,takesValue:true,placeholder:placeholderOf(field)}))}function updateFlags(fields){const flags=[];for(const field of fields){
4
4
  flags.push({name:field.flag,summary:field.summary,takesValue:true,placeholder:placeholderOf(field)});if(field.kind==="ref")flags.push({name:field.clearFlag,summary:field.clearSummary,takesValue:false})}return flags}function integerValue(field,raw){const trimmed=raw.trim();const value=/^\d+$/.test(trimmed)?Number(trimmed):Number.NaN;const tooLarge=field.max!==void 0&&value>field.max;if(!Number.isSafeInteger(value)||value<field.min||tooLarge){const range=field.max!==void 0?`${field.min} \u4EE5\u4E0A ${field.
5
5
  max} \u4EE5\u4E0B`:`${field.min} \u4EE5\u4E0A`;throw new UsageError(`${field.flag} \u306F ${range}\u306E\u6574\u6570\u3067\u6307\u5B9A\u3057\u3066\u304F\u3060\u3055\u3044: ${raw}`,`${field.label}\u3092\u6574\u6570\u3067\u6307\u5B9A\u3057\u3066\u304F\u3060\u3055\u3044\u3002`)}return value}function fieldBody(input,fields){const body={};for(const field of fields){switch(field.kind){case"text":{const value=boundedText(input,field.flag,{maxChars:field.maxChars,label:field.label});if(value!==void 0)body[field.
6
6
  key]=value;break}case"integer":{const raw=input.flags.get(field.flag);if(raw!==void 0)body[field.key]=integerValue(field,raw);break}case"boolean":{const raw=input.flags.get(field.flag);if(raw!==void 0)body[field.key]=booleanText(field.flag,raw);break}case"enum":{const raw=input.flags.get(field.flag);if(raw===void 0)break;const value=raw.trim().toLowerCase();if(!field.values.includes(value)){throw new UsageError(`${field.flag} \u306B\u300C${raw}\u300D\u306F\u6307\u5B9A\u3067\u304D\u307E\u305B\u3093`,
@@ -1,6 +1,6 @@
1
1
  import { createRequire as __twpCreateRequire } from 'node:module';
2
2
  const require = __twpCreateRequire(import.meta.url);
3
- import{salesAdminForbidden}from"./chunk-YPMT453N.js";import{nonEmpty,positiveInteger}from"./chunk-IOGMOXYF.js";import{withResolved}from"./chunk-LXIAOCUW.js";import{isRecord,pick}from"./chunk-VTQAI52S.js";import{ApiResponseError,UsageError}from"./chunk-UFND7FBC.js";var PATH="/api/v2/sales/receivables";var FORBIDDEN=salesAdminForbidden("\u58F2\u639B\u91D1\u6B8B\u9AD8\u3068\u7DE0\u3081");var CLOSING_LIST_MAX=36;var SUMMARY_LABELS=[["previous_balance","\u524D\u6708\u6B8B\u9AD8"],["current_debit","\u5F53\u6708\u501F\u65B9\uFF08\u5F53\u6708\u8ACB\u6C42\u984D\uFF09"],["current_credit","\u5F53\u6708\u8CB8\u65B9\uFF08\u5F53\u6708\u5165\u91D1\u5F15\u5F53\u984D\uFF09"],["current_balance","\u5F53\u6708\u6B8B\u9AD8"],["current_month_uncollected","\u2460 \u5F53\u6708\u8ACB\u6C42 \u672A\u56DE\u53CE"],
3
+ import{salesAdminForbidden}from"./chunk-VIU2HPWM.js";import{nonEmpty,positiveInteger}from"./chunk-IOGMOXYF.js";import{withResolved}from"./chunk-LXIAOCUW.js";import{isRecord,pick}from"./chunk-VTQAI52S.js";import{ApiResponseError,UsageError}from"./chunk-UFND7FBC.js";var PATH="/api/v2/sales/receivables";var FORBIDDEN=salesAdminForbidden("\u58F2\u639B\u91D1\u6B8B\u9AD8\u3068\u7DE0\u3081");var CLOSING_LIST_MAX=36;var SUMMARY_LABELS=[["previous_balance","\u524D\u6708\u6B8B\u9AD8"],["current_debit","\u5F53\u6708\u501F\u65B9\uFF08\u5F53\u6708\u8ACB\u6C42\u984D\uFF09"],["current_credit","\u5F53\u6708\u8CB8\u65B9\uFF08\u5F53\u6708\u5165\u91D1\u5F15\u5F53\u984D\uFF09"],["current_balance","\u5F53\u6708\u6B8B\u9AD8"],["current_month_uncollected","\u2460 \u5F53\u6708\u8ACB\u6C42 \u672A\u56DE\u53CE"],
4
4
  ["previous_uncollected","\u2461 \u524D\u6708\u4EE5\u524D \u672A\u5165\u91D1\u58F2\u639B\u91D1"],["advance_received","\u524D\u53D7\u91D1\uFF08\u7FCC\u6708\u4EE5\u964D\u8ACB\u6C42\u3078\u306E\u5165\u91D1\uFF09"],["future_invoice_total","\u2462 \u7FCC\u6708\u4EE5\u964D \u58F2\u639B\u91D1\uFF08\u8ACB\u6C42\u7DCF\u984D\u30FB\u53C2\u8003\uFF09"]];var ITEM_COLUMNS=["invoice_id","invoice_no","company_name","title","invoice_date","due_date","total","collected","uncollected"];var CLOSING_COLUMNS=["year_mo\
5
5
  nth","basis_date","closed_at","closed_by_name","has_variance"];function usageOf(op){return`twp receivable ${op} help`}function yen(value){return typeof value==="number"?`${value.toLocaleString("ja-JP")} \u5186`:"\uFF08\u4E0D\u660E\uFF09"}function text(value){return typeof value==="string"||typeof value==="number"?String(value):""}function yearMonthValue(raw,label){const value=raw.trim();if(!/^\d{4}-(0[1-9]|1[0-2])$/.test(value))throw new UsageError(`${label} \u306F YYYY-MM \u306E\u5F62\u3067\u6307\u5B9A\u3057\u3066\u304F\u3060\u3055\u3044: ${raw}`,
6
6
  "\u4F8B: 2026-09");return value}function previousYearMonth(yearMonth){const[y,m]=yearMonth.split("-").map(Number);return m===1?`${y-1}-12`:`${y}-${String(m-1).padStart(2,"0")}`}function envelope(body,what){if(!isRecord(body)||body["result"]!==true)throw new ApiResponseError(`${what}\u306E\u5FDC\u7B54\u306E\u5F62\u304C\u60F3\u5B9A\u3068\u9055\u3044\u307E\u3059\u3002\u63A5\u7D9A\u5148\u3092\u78BA\u8A8D\u3057\u3066\u304F\u3060\u3055\u3044\u3002`);return body}function withoutResult(body){return Object.
@@ -1,6 +1,6 @@
1
1
  import { createRequire as __twpCreateRequire } from 'node:module';
2
2
  const require = __twpCreateRequire(import.meta.url);
3
- import{salesAdminForbidden}from"./chunk-YPMT453N.js";import{featureLicenseGuidance,licenseForbidden}from"./chunk-XXVYGQ72.js";import{booleanText,boundedText}from"./chunk-XDHLO54T.js";import{SALES_ESTIMATE_FORMATS_PATH,SALES_ESTIMATE_NO_RULES_PATH,SALES_INVOICE_NO_RULES_PATH,SALES_PURCHASE_NO_RULES_PATH,SALES_ROUNDING_SETTING_PATH,isExactNumericId}from"./chunk-D5FEOBB6.js";import{repeatedValues}from"./chunk-F7K37QG6.js";import{LIST_PAGING_HELP,PAGE_NUMBER_LIST_FLAGS,
3
+ import{salesAdminForbidden}from"./chunk-VIU2HPWM.js";import{featureLicenseGuidance,licenseForbidden}from"./chunk-P7JCZYAI.js";import{booleanText,boundedText}from"./chunk-XDHLO54T.js";import{SALES_ESTIMATE_FORMATS_PATH,SALES_ESTIMATE_NO_RULES_PATH,SALES_INVOICE_NO_RULES_PATH,SALES_PURCHASE_NO_RULES_PATH,SALES_ROUNDING_SETTING_PATH,isExactNumericId}from"./chunk-XWW63XJJ.js";import{repeatedValues}from"./chunk-F7K37QG6.js";import{LIST_PAGING_HELP,PAGE_NUMBER_LIST_FLAGS,
4
4
  nonEmpty,pageNumberPaging,pageNumberQuery,pageRangeNotes}from"./chunk-IOGMOXYF.js";import{requireResolved,withResolved}from"./chunk-LXIAOCUW.js";import{acknowledgement,isRecord,pick}from"./chunk-VTQAI52S.js";import{ApiResponseError,UsageError}from"./chunk-UFND7FBC.js";var INT_MAX=2147483647;var MEMBER_FORBIDDEN=licenseForbidden(featureLicenseGuidance("\u8CA9\u58F2\u7BA1\u7406"));function envelope(body,what){if(!isRecord(body)||body["result"]!==true)throw new ApiResponseError(`${what}\u306E\u5FDC\u7B54\u306E\u5F62\u304C\u60F3\u5B9A\u3068\u9055\u3044\u307E\u3059\u3002\u63A5\u7D9A\u5148\u3092\u78BA\u8A8D\u3057\u3066\u304F\u3060\u3055\u3044\u3002`);return body}function recordOf(body,what){const data=envelope(body,what)["data"];if(!isRecord(data)||typeof data["id"]!==
5
5
  "string")throw new ApiResponseError(`${what}\u306E\u5FDC\u7B54\u306B data.id \u304C\u3042\u308A\u307E\u305B\u3093\u3002\u63A5\u7D9A\u5148\u3092\u78BA\u8A8D\u3057\u3066\u304F\u3060\u3055\u3044\u3002`);return data}function serverMessage(body){const message=isRecord(body)?body["message"]:void 0;return typeof message==="string"&&message!==""?[message]:[]}function text(value){return typeof value==="string"||typeof value==="number"?String(value):""}function integerValue(flag,raw,min,max=INT_MAX){const trimmed=raw.
6
6
  trim();const value=/^\d+$/.test(trimmed)?Number(trimmed):Number.NaN;if(!Number.isSafeInteger(value)||value<min||value>max)throw new UsageError(`${flag} \u306F ${min} \u4EE5\u4E0A ${max} \u4EE5\u4E0B\u306E\u6574\u6570\u3067\u6307\u5B9A\u3057\u3066\u304F\u3060\u3055\u3044: ${raw}`);return value}var RULE_COLUMNS=["id","rule_name","prefix","digit_count","current_number","count_up_num","next_number","sort_order"];function nextNumber(rule,purchaseFormat){const current=rule["current_number"];const step=rule["\
@@ -1,10 +1,10 @@
1
1
  import { createRequire as __twpCreateRequire } from 'node:module';
2
2
  const require = __twpCreateRequire(import.meta.url);
3
- import{stripTerminalControls}from"./chunk-NHYMHCAT.js";var SENSITIVE_HEADERS=new Set(["authorization","proxy-authorization","cookie","set-cookie","x-api-key","x-auth-token","x-vercel-protection-bypass"]);var REDACTED="***\uFF08\u4F0F\u5B57\uFF09";var SECRET_KEY_PATTERN="[A-Za-z0-9_-]*(?:token|secret|password|passwd|api[_-]?key|credential|signature)[A-Za-z0-9_-]*";var NOT_SECRET_FLAGS="(?:starting-token)";var NOT_SECRET_QUERY="(?:skiptoken)";function redactSecrets(text){return text.replace(/\bBearer\s+[^\s"'`,;)\]}]+/gi,`Bearer ${REDACTED}`).replace(
4
- /(\/v2\/(?:admin\/)?invitations\/)[A-Za-z0-9_-]{16,}/g,`$1${REDACTED}`).replace(new RegExp(`("${SECRET_KEY_PATTERN}"\\s*:\\s*)"(?:[^"\\\\]|\\\\.)*"`,"gi"),`$1"${REDACTED}"`).replace(new RegExp(`([?&](?!${NOT_SECRET_QUERY}=)${SECRET_KEY_PATTERN}=)[^&\\s"'\`,;)\\]}]+`,"gi"),`$1${REDACTED}`).replace(new RegExp(`(--(?!${NOT_SECRET_FLAGS}(?:=|\\s))${SECRET_KEY_PATTERN}(?:=|\\s+))('[^']*'|"[^"]*"|[A-Za-z0-9_.~+/=|:%-]+)`,"gi"),`$1${REDACTED}`)}var SECRET_KEY_NAME=new RegExp(`^${SECRET_KEY_PATTERN}$`,"\
5
- i");function redactSecretValues(value){if(Array.isArray(value))return value.map(item=>redactSecretValues(item));if(value!==null&&typeof value==="object"){const out={};for(const[key,item]of Object.entries(value)){out[key]=SECRET_KEY_NAME.test(key)?REDACTED:redactSecretValues(item)}return out}return value}function formatHeaders(headers){if(!headers)return[];const entries=headers instanceof Headers?[...headers.entries()]:Array.isArray(headers)?headers:Object.entries(headers);return entries.map(([name,
6
- value])=>{const shown=SENSITIVE_HEADERS.has(name.toLowerCase())?REDACTED:redactSecrets(String(value));return` ${name.toLowerCase()}: ${shown}`})}var BODY_LIMIT=4e3;function omitAttachmentBytes(body){return body.replace(/"contentBytes":"([A-Za-z0-9+/=]*)"/g,(_,b64)=>`"contentBytes":"\uFF08base64 ${b64.length} \u6587\u5B57\u30FB\u51FA\u529B\u3057\u306A\u3044\uFF09"`)}function formatBody(raw){const safe=omitAttachmentBytes(redactSecrets(stripTerminalControls(raw)));return safe.length>BODY_LIMIT?`${safe.
7
- slice(0,BODY_LIMIT)}
3
+ import{stripTerminalControls}from"./chunk-NHYMHCAT.js";var SENSITIVE_HEADERS=new Set(["authorization","proxy-authorization","cookie","set-cookie","x-api-key","x-auth-token","x-vercel-protection-bypass"]);var REDACTED="***\uFF08\u4F0F\u5B57\uFF09";var SECRET_KEY_PATTERN="[A-Za-z0-9_-]*(?:token|secret|password|passwd|api[_-]?key|credential|signature|tempauth|upload_?url)[A-Za-z0-9_-]*";var NOT_SECRET_FLAGS="(?:starting-token)";var NOT_SECRET_QUERY="(?:skiptoken)";function redactSecrets(text){return text.replace(/\bBearer\s+[^\s"'`,;)\]}]+/gi,`Bearer ${REDACTED}`).
4
+ replace(/(\/v2\/(?:admin\/)?invitations\/)[A-Za-z0-9_-]{16,}/g,`$1${REDACTED}`).replace(new RegExp(`("${SECRET_KEY_PATTERN}"\\s*:\\s*)"(?:[^"\\\\]|\\\\.)*"`,"gi"),`$1"${REDACTED}"`).replace(new RegExp(`([?&](?!${NOT_SECRET_QUERY}=)${SECRET_KEY_PATTERN}=)[^&\\s"'\`,;)\\]}]+`,"gi"),`$1${REDACTED}`).replace(new RegExp(`(--(?!${NOT_SECRET_FLAGS}(?:=|\\s))${SECRET_KEY_PATTERN}(?:=|\\s+))('[^']*'|"[^"]*"|[A-Za-z0-9_.~+/=|:%-]+)`,"gi"),`$1${REDACTED}`)}var SECRET_KEY_NAME=new RegExp(`^${SECRET_KEY_PATTERN}\
5
+ $`,"i");function redactSecretValues(value){if(Array.isArray(value))return value.map(item=>redactSecretValues(item));if(value!==null&&typeof value==="object"){const out={};for(const[key,item]of Object.entries(value)){out[key]=SECRET_KEY_NAME.test(key)?REDACTED:redactSecretValues(item)}return out}return value}function formatHeaders(headers){if(!headers)return[];const entries=headers instanceof Headers?[...headers.entries()]:Array.isArray(headers)?headers:Object.entries(headers);return entries.map(
6
+ ([name,value])=>{const shown=SENSITIVE_HEADERS.has(name.toLowerCase())?REDACTED:redactSecrets(String(value));return` ${name.toLowerCase()}: ${shown}`})}var BODY_LIMIT=4e3;function omitAttachmentBytes(body){return body.replace(/"contentBytes":"([A-Za-z0-9+/=]*)"/g,(_,b64)=>`"contentBytes":"\uFF08base64 ${b64.length} \u6587\u5B57\u30FB\u51FA\u529B\u3057\u306A\u3044\uFF09"`)}function formatBody(raw){const safe=omitAttachmentBytes(redactSecrets(stripTerminalControls(raw)));return safe.length>BODY_LIMIT?
7
+ `${safe.slice(0,BODY_LIMIT)}
8
8
  \u2026\uFF08\u4EE5\u964D ${safe.length-BODY_LIMIT} \u6587\u5B57\u3092\u7701\u7565\uFF09`:safe}function isTextualContentType(contentType){if(contentType===null)return false;return/^\s*(text\/|application\/(json|xml|javascript|x-www-form-urlencoded)|application\/[\w.+-]*\+(json|xml))/i.test(contentType)}function withDebug(inner,options={}){const write=options.write??(text=>void process.stderr.write(text));const now=options.now??(()=>Date.now());return async(input,init)=>{const method=init?.method??
9
9
  "GET";const lines=[`[debug] \u2192 ${method} ${redactSecrets(input)}`,...formatHeaders(init?.headers)];if(options.omitBodies!==void 0&&init?.body!==void 0&&init.body!==null)lines.push(` \uFF08\u672C\u6587\u306F${options.omitBodies}\u305F\u3081\u51FA\u529B\u3057\u306A\u3044\uFF09`);else if(typeof init?.body==="string")lines.push(` ${formatBody(init.body)}`);else if(init?.body instanceof Uint8Array)lines.push(` \uFF08\u672C\u6587\u306F ${init.body.byteLength} \u30D0\u30A4\u30C8\u306E\u30D0\u30A4\u30C8\u5217\u3002\u51FA\u529B\u3057\u306A\u3044\uFF09`);
10
10
  write(`${lines.join("\n")}
@@ -1,6 +1,6 @@
1
1
  import { createRequire as __twpCreateRequire } from 'node:module';
2
2
  const require = __twpCreateRequire(import.meta.url);
3
- import{USER_REF_FLAG,USER_REF_HELP,userPath}from"./chunk-IXFMXUNT.js";import{MANHOUR_DESCRIPTION,MANHOUR_FROM_FLAG,MANHOUR_TO_FLAG,manhourNotes,manhourQuery,manhourRows,workloadDistributionNotes,workloadDistributionRows}from"./chunk-E7MUDY4P.js";import{boundedText,isoDate}from"./chunk-XDHLO54T.js";import{readBody}from"./chunk-ORUDW52G.js";import{PROJECT_MEMBERS_LIMIT,resolveNamed}from"./chunk-D5FEOBB6.js";import{collapsesInUrlPath,safeProjectIdPolicy}from"./chunk-GMBJTG6A.js";
3
+ import{USER_REF_FLAG,USER_REF_HELP,userPath}from"./chunk-IXFMXUNT.js";import{MANHOUR_DESCRIPTION,MANHOUR_FROM_FLAG,MANHOUR_TO_FLAG,manhourNotes,manhourQuery,manhourRows,workloadDistributionNotes,workloadDistributionRows}from"./chunk-E7MUDY4P.js";import{boundedText,isoDate}from"./chunk-XDHLO54T.js";import{readBody}from"./chunk-ORUDW52G.js";import{PROJECT_MEMBERS_LIMIT,resolveNamed}from"./chunk-XWW63XJJ.js";import{collapsesInUrlPath,safeProjectIdPolicy}from"./chunk-GMBJTG6A.js";
4
4
  import{LIST_FLAGS,LIST_PAGING_HELP,envelopePaging,nonEmpty,positiveInteger}from"./chunk-IOGMOXYF.js";import{requireResolved,singleRef,withResolved}from"./chunk-LXIAOCUW.js";import{isRecord,pick}from"./chunk-VTQAI52S.js";import{ApiResponseError,UsageError}from"./chunk-UFND7FBC.js";var PROJECT_FLAG={name:"--project",summary:"\u30D7\u30ED\u30B8\u30A7\u30AF\u30C8\u306E\u30B3\u30FC\u30C9\u307E\u305F\u306F ID\uFF08\u7701\u7565\u6642\u306F TWP_PROJECT / .twp/config.json / ~/.twp/config.json\uFF09",takesValue:true,placeholder:"<\u30B3\u30FC\u30C9|ID>"};var ROLE_FLAG={name:"--role",summary:"\u5F79\u5272\uFF08member / manager \u306A\u3069\u30FB\u5024\u306F\u30B5\u30FC\u30D0\u304C\u691C\u67FB\u3059\u308B\uFF09",takesValue:true,placeholder:"<\u5F79\u5272>"};var START_DATE_FLAG={name:"\
5
5
  --start-date",summary:"\u53C2\u753B\u958B\u59CB\u65E5\uFF08YYYY-MM-DD\uFF09",takesValue:true,placeholder:"<YYYY-MM-DD>"};var END_DATE_FLAG={name:"--end-date",summary:"\u53C2\u753B\u7D42\u4E86\u65E5\uFF08YYYY-MM-DD\uFF09",takesValue:true,placeholder:"<YYYY-MM-DD>"};var PERIOD_FILE_FLAG={name:"--period-file",summary:"\u7A3C\u50CD\u671F\u9593\uFF08assignment_periods\uFF09\u306E JSON \u914D\u5217\u30D5\u30A1\u30A4\u30EB\uFF08- \u3067\u6A19\u6E96\u5165\u529B\uFF09",takesValue:true,placeholder:"<\u30D1\u30B9>"};
6
6
  var MEMO_FLAG={name:"--memo",summary:"\u30E1\u30E2\uFF0810,000 \u6587\u5B57\u307E\u3067\uFF09",takesValue:true,placeholder:"<\u6587\u5B57\u5217>"};var CLEAR_FLAG={name:"--clear",summary:"\u5225\u540D\u3092\u6D88\u3059",takesValue:false};var MEMO_MAX_CHARS=1e4;var PERIOD_FILE_MAX_CHARS=2e5;var ALIAS_MAX_CHARS=255;var PERIOD_KEYS=["id","start_date","end_date","daily_hours","total_hours","input_mode"];var PERIOD_REQUIRED=["start_date","end_date","daily_hours"];var ROLE_HELP="--role \u306E\u5024\u306F\u30B5\u30FC\u30D0\u304C\u691C\u67FB\u3057\u307E\u3059\uFF08CLI\
@@ -1,6 +1,6 @@
1
1
  import { createRequire as __twpCreateRequire } from 'node:module';
2
2
  const require = __twpCreateRequire(import.meta.url);
3
- import{CUSTOMER_FLAG,CUSTOMER_LICENSE,childForbidden,levelForbidden,prepareCustomerFlag}from"./chunk-EWTFE233.js";import{inspectLocalFile}from"./chunk-HNUBM24L.js";import{createFlags,fieldBody,hasAnyField,updateFlags}from"./chunk-JNPCHV7S.js";import{checkUploadQuota}from"./chunk-2YNZ4MRT.js";import{booleanText}from"./chunk-XDHLO54T.js";import{CUSTOMERS_PATH,isExactNumericId}from"./chunk-D5FEOBB6.js";import{isSafePathSegment}from"./chunk-GMBJTG6A.js";import{
3
+ import{CUSTOMER_FLAG,CUSTOMER_LICENSE,childForbidden,levelForbidden,prepareCustomerFlag}from"./chunk-KPXJALCL.js";import{inspectLocalFile}from"./chunk-HNUBM24L.js";import{createFlags,fieldBody,hasAnyField,updateFlags}from"./chunk-3B5PVPGU.js";import{checkUploadQuota}from"./chunk-2YNZ4MRT.js";import{booleanText}from"./chunk-XDHLO54T.js";import{CUSTOMERS_PATH,isExactNumericId}from"./chunk-XWW63XJJ.js";import{isSafePathSegment}from"./chunk-GMBJTG6A.js";import{
4
4
  ApiError}from"./chunk-IF2K4PM5.js";import{NotLoggedInError,SessionExpiredError}from"./chunk-XNLIEUAW.js";import{nonEmpty}from"./chunk-IOGMOXYF.js";import{requireResolved,withResolved}from"./chunk-LXIAOCUW.js";import{acknowledgement,isRecord,pick}from"./chunk-VTQAI52S.js";import{ApiResponseError,UsageError}from"./chunk-UFND7FBC.js";import fs from"fs";import path from"path";var CONTRACT_TYPES=["basic_contract","nda","other"];var CONTRACT_TYPE_HELP="basic_contract\uFF1D\u57FA\u672C\u5951\u7D04\u66F8 / nda\uFF1D\u6A5F\u5BC6\u4FDD\u6301\u5951\u7D04\u66F8 / other\uFF1D\u305D\u306E\u4ED6\u5951\u7D04\u66F8\u985E";var FILE_NAME_MAX_CHARS=255;var PDF_MAGIC="%PDF-";var CONTRACT_FIELDS=[{kind:"text",flag:"--name",key:"document_name",label:"\u66F8\u985E\u540D",maxChars:255,summary:"\u66F8\u985E\u540D\uFF08create \u3067\u306F\u5FC5\u9808\uFF09"},{kind:"enum",flag:"--type",key:"\
5
5
  document_type",values:CONTRACT_TYPES,summary:`\u66F8\u985E\u7A2E\u5225\uFF08${CONTRACT_TYPE_HELP}\u30FBcreate \u3067\u306F\u5FC5\u9808\uFF09`}];var CONTRACT_COLUMNS=["document_id","company_id","document_type","document_name","current_version","updated_by_name","updated_at"];var VERSION_COLUMNS=["version_number","file_name","file_size","is_current","created_by_name","created_at"];var CASE_COLUMNS=["document_id","document_type_label","document_name","estimate_no","estimate_title","project_name","c\
6
6
  urrent_version","updated_at"];var FILE_FLAG={name:"--file",summary:"\u30A2\u30C3\u30D7\u30ED\u30FC\u30C9\u3059\u308B PDF \u30D5\u30A1\u30A4\u30EB\u306E\u30D1\u30B9\uFF08\u5FC5\u9808\uFF09",takesValue:true,placeholder:"<\u30D1\u30B9.pdf>"};var OUT_FLAG={name:"--out",summary:"\u66F8\u304D\u51FA\u3057\u5148\u306E\u30D5\u30A1\u30A4\u30EB\u30D1\u30B9\uFF08\u5FC5\u9808\u3002\u6A19\u6E96\u51FA\u529B\u3078\u306F\u51FA\u3057\u307E\u305B\u3093\uFF09",takesValue:true,placeholder:"<\u30D1\u30B9>"};var FORCE_FLAG={
@@ -1,6 +1,6 @@
1
1
  import { createRequire as __twpCreateRequire } from 'node:module';
2
2
  const require = __twpCreateRequire(import.meta.url);
3
- import{describeError,normalizeRequiredPlatforms}from"./chunk-G2THOTBW.js";import{httpFetch}from"./chunk-J7QYPKVK.js";var ScheduleApi=class{constructor(api){this.api=api}api;async definitions(){const res=await this.api.request("GET","/schedules/definitions");if(!res.ok)return fetchError("\u5B9A\u671F\u30B9\u30B1\u30B8\u30E5\u30FC\u30EB\u306E\u5B9A\u7FA9\u3092\u53D6\u5F97\u3067\u304D\u307E\u305B\u3093",res);const body=res.json??{};const schedules=body["schedules"];if(!Array.isArray(schedules)){return{kind:"error",message:`\u5B9A\u7FA9\u306E\u5FDC\u7B54\u306B schedules \u914D\u5217\u304C\u3042\u308A\u307E\u305B\u3093\uFF08\u5FDC\u7B54\u306E\u5148\u982D: ${res.
3
+ import{describeError,normalizeRequiredPlatforms}from"./chunk-JTJWDV5U.js";import{httpFetch}from"./chunk-J7QYPKVK.js";var ScheduleApi=class{constructor(api){this.api=api}api;async definitions(){const res=await this.api.request("GET","/schedules/definitions");if(!res.ok)return fetchError("\u5B9A\u671F\u30B9\u30B1\u30B8\u30E5\u30FC\u30EB\u306E\u5B9A\u7FA9\u3092\u53D6\u5F97\u3067\u304D\u307E\u305B\u3093",res);const body=res.json??{};const schedules=body["schedules"];if(!Array.isArray(schedules)){return{kind:"error",message:`\u5B9A\u7FA9\u306E\u5FDC\u7B54\u306B schedules \u914D\u5217\u304C\u3042\u308A\u307E\u305B\u3093\uFF08\u5FDC\u7B54\u306E\u5148\u982D: ${res.
4
4
  raw.slice(0,120)}\uFF09`,status:res.status}}const gates=Array.isArray(body["gates"])?body["gates"]:[];return{kind:"ok",config:{schedules,gates,max_per_cycle:body["max_per_cycle"],warnings:Array.isArray(body["warnings"])?body["warnings"]:[]}}}async history(since){const suffix=since?`/schedules/history?since=${encodeURIComponent(since)}`:"/schedules/history";const res=await this.api.request("GET",suffix);if(!res.ok)return fetchError("\u5B9A\u671F\u30B9\u30B1\u30B8\u30E5\u30FC\u30EB\u306E\u5C65\u6B74\u3092\u53D6\u5F97\u3067\u304D\u307E\u305B\u3093",
5
5
  res);const body=res.json??{};const rows=body["rows"];if(!Array.isArray(rows)){return{kind:"error",message:`\u5C65\u6B74\u306E\u5FDC\u7B54\u306B rows \u914D\u5217\u304C\u3042\u308A\u307E\u305B\u3093\uFF08\u5FDC\u7B54\u306E\u5148\u982D: ${res.raw.slice(0,120)}\uFF09`,status:res.status}}if(body["truncated"]===true||body["reason"]==="history_truncated"){return{kind:"error",message:"\u5C65\u6B74\u306E\u8D70\u67FB\u304C\u6253\u3061\u5207\u3089\u308C\u307E\u3057\u305F\uFF08\u5224\u5B9A\u306B\u4F7F\u3048\u307E\u305B\u3093\uFF09",
6
6
  status:res.status}}const windowCounts={};const counts=body["window_counts"];if(counts&&typeof counts==="object"){for(const[k,v]of Object.entries(counts)){if(typeof v==="number"){if(Number.isInteger(v))windowCounts[k]=v}else if(/^-?\d+$/.test(String(v))){windowCounts[k]=Number(String(v))}}}const normalized=rows.map(r=>{const row=r??{};return{ts:str(row["ts"]),schedule_id:str(row["schedule_id"]),window_key:str(row["window_key"]),status:str(row["status"]),item_id:str(row["item_id"]),args:str(row["a\
@@ -1,6 +1,6 @@
1
1
  import { createRequire as __twpCreateRequire } from 'node:module';
2
2
  const require = __twpCreateRequire(import.meta.url);
3
- import{featureLicenseGuidance}from"./chunk-XXVYGQ72.js";import{isExactNumericId}from"./chunk-D5FEOBB6.js";import{nonEmpty}from"./chunk-IOGMOXYF.js";import{UsageError}from"./chunk-UFND7FBC.js";var PDF_PATH="/api/v2/sales/pdf";var FEATURE_DENIED="\u3053\u306E\u6A5F\u80FD\u306B\u30A2\u30AF\u30BB\u30B9\u3059\u308B\u6A29\u9650\u304C\u3042\u308A\u307E\u305B\u3093\u3002";function salesFeatureDenied(body){return body?.error==="permission_denied"||body?.error==="forbidden"&&body.error_description===FEATURE_DENIED}function pdfForbidden(body){if(salesFeatureDenied(body))return featureLicenseGuidance("\u8CA9\u58F2\u7BA1\u7406");const reason=body?.error;if(typeof reason==="string"&&reason.endsWith(
3
+ import{featureLicenseGuidance}from"./chunk-P7JCZYAI.js";import{isExactNumericId}from"./chunk-XWW63XJJ.js";import{nonEmpty}from"./chunk-IOGMOXYF.js";import{UsageError}from"./chunk-UFND7FBC.js";var PDF_PATH="/api/v2/sales/pdf";var FEATURE_DENIED="\u3053\u306E\u6A5F\u80FD\u306B\u30A2\u30AF\u30BB\u30B9\u3059\u308B\u6A29\u9650\u304C\u3042\u308A\u307E\u305B\u3093\u3002";function salesFeatureDenied(body){return body?.error==="permission_denied"||body?.error==="forbidden"&&body.error_description===FEATURE_DENIED}function pdfForbidden(body){if(salesFeatureDenied(body))return featureLicenseGuidance("\u8CA9\u58F2\u7BA1\u7406");const reason=body?.error;if(typeof reason==="string"&&reason.endsWith(
4
4
  "\u6A29\u9650\u304C\u3042\u308A\u307E\u305B\u3093")){return`${reason}\uFF08\u30D7\u30ED\u30B8\u30A7\u30AF\u30C8\u306B\u7D10\u3065\u304F\u66F8\u985E\u306F\u305D\u306E\u30D7\u30ED\u30B8\u30A7\u30AF\u30C8\u306E\u30E1\u30F3\u30D0\u30FC\u3001\u7D10\u3065\u304B\u306A\u3044\u66F8\u985E\u306F\u4F5C\u6210\u8005\u30FB\u62C5\u5F53\u8005\u3068\u7BA1\u7406\u8005\u3060\u3051\u304C\u51FA\u529B\u3067\u304D\u307E\u3059\uFF09`}return void 0}var ESTIMATE={name:"estimate",label:"\u898B\u7A4D",noExample:"EST0000063",
5
5
  defaultKind:"estimate",kinds:{estimate:{segment:"estimate",label:"\u898B\u7A4D\u66F8"},order:{segment:"order",label:"\u6CE8\u6587\u66F8"},"order-acceptance":{segment:"order-acceptance",label:"\u6CE8\u6587\u8ACB\u66F8"}}};var INVOICE={name:"invoice",label:"\u8ACB\u6C42",noExample:"INV0000170",defaultKind:"invoice",kinds:{invoice:{segment:"invoice",label:"\u8ACB\u6C42\u66F8"},delivery:{segment:"delivery",label:"\u7D0D\u54C1\u66F8"},inspection:{segment:"inspection",label:"\u691C\u53CE\u66F8"}}};var PURCHASE={
6
6
  name:"purchase",label:"\u4ED5\u5165",defaultKind:"order",kinds:{order:{segment:"purchase-order",label:"\u6CE8\u6587\u66F8"},"order-acceptance":{segment:"purchase-order-acceptance",label:"\u6CE8\u6587\u8ACB\u66F8"}}};var OUT_FLAG={name:"--out",summary:"\u66F8\u304D\u51FA\u3057\u5148\u306E\u30D5\u30A1\u30A4\u30EB\u30D1\u30B9\uFF08\u5FC5\u9808\uFF09",takesValue:true,placeholder:"<\u30D1\u30B9.pdf>"};var FORCE_FLAG={name:"--force",summary:"\u65E2\u5B58\u306E\u30D5\u30A1\u30A4\u30EB\u3092\u4E0A\u66F8\u304D\u3059\u308B",
@@ -12,4 +12,4 @@ json;const items=body?.["items"];if(!Array.isArray(items))return null;all.push(.
12
12
  if(!res.ok)return null;const body=res.json;const items=body?.["items"];if(!Array.isArray(items))return null;all.push(...filterByStatus(items,status));const pagination=body?.["pagination"];const hasMore=(pagination?.["has_more"]??body?.["has_more"])===true;const next=pagination?.["next_cursor"]??body?.["next_cursor"];if(!hasMore||!next)break;cursor=next;if(page===19)return null}}return all}async request(method,suffix,body){let token;try{token=await this.opts.session.getAccessToken()}catch(err){return{
13
13
  ok:false,status:null,json:null,raw:"",transportError:err.message}}let res=await this.send(method,suffix,token,body);if(res.status===401){try{token=await this.opts.session.refresh(token);res=await this.send(method,suffix,token,body)}catch(err){return{ok:false,status:401,json:null,raw:res.raw,transportError:err.message}}}return res}async send(method,suffix,token,body){const fetchImpl=this.opts.fetchImpl??httpFetch;const controller=new AbortController;const timer=setTimeout(()=>controller.abort(),this.
14
14
  opts.timeoutMs??6e4);try{const res=await fetchImpl(`${this.base}${suffix}`,{method,headers:{Authorization:`Bearer ${token}`,"Content-Type":"application/json",Accept:"application/json"},signal:controller.signal,...body===void 0?{}:{body:JSON.stringify(body)}});const raw=await res.text();let json=null;if(raw.trim()!==""){try{json=JSON.parse(raw)}catch{json=null}}return{ok:res.ok,status:res.status,json,raw,transportError:null}}catch(err){const reason=err.name==="AbortError"?"timeout":err.message;return{
15
- ok:false,status:null,json:null,raw:"",transportError:reason}}finally{clearTimeout(timer)}}};function pick(json,path){let cur=json;for(const part of path.split(".")){if(cur===null||typeof cur!=="object")return void 0;cur=cur[part]}return cur===null?void 0:cur}function pickString(json,path){const v=pick(json,path);if(typeof v==="string")return v;if(typeof v==="number")return String(v);if(typeof v==="boolean")return v?"true":"false";return""}export{describeError,isPermanent,normalizeRequiredPlatforms,filterByStatus,AgentLoopApi,pick,pickString};
15
+ ok:false,status:null,json:null,raw:"",transportError:reason}}finally{clearTimeout(timer)}}};function pick(json,path){let cur=json;for(const part of path.split(".")){if(cur===null||typeof cur!=="object")return void 0;cur=cur[part]}return cur===null?void 0:cur}function pickString(json,path){const v=pick(json,path);if(typeof v==="string")return v;if(typeof v==="number")return String(v);if(typeof v==="boolean")return v?"true":"false";return""}export{describeError,isPermanent,RUNNER_PLATFORMS,normalizeRequiredPlatforms,filterByStatus,AgentLoopApi,pick,pickString};
@@ -1,6 +1,6 @@
1
1
  import { createRequire as __twpCreateRequire } from 'node:module';
2
2
  const require = __twpCreateRequire(import.meta.url);
3
- import{contentTypeFor,inspectLocalFile,issued}from"./chunk-HNUBM24L.js";import{createFlags,fieldBody,hasAnyField,updateFlags}from"./chunk-JNPCHV7S.js";import{checkUploadQuota}from"./chunk-2YNZ4MRT.js";import{readCsvFileText}from"./chunk-OHXZO5WK.js";import{featureLicenseGuidance}from"./chunk-XXVYGQ72.js";import{CUSTOMERS_PATH,SALES_COMPANIES_PATH,isExactNumericId}from"./chunk-D5FEOBB6.js";import{isSafePathSegment}from"./chunk-GMBJTG6A.js";import{ApiError,
3
+ import{contentTypeFor,inspectLocalFile,issued}from"./chunk-HNUBM24L.js";import{createFlags,fieldBody,hasAnyField,updateFlags}from"./chunk-3B5PVPGU.js";import{checkUploadQuota}from"./chunk-2YNZ4MRT.js";import{readCsvFileText}from"./chunk-OHXZO5WK.js";import{featureLicenseGuidance}from"./chunk-P7JCZYAI.js";import{CUSTOMERS_PATH,SALES_COMPANIES_PATH,isExactNumericId}from"./chunk-XWW63XJJ.js";import{isSafePathSegment}from"./chunk-GMBJTG6A.js";import{ApiError,
4
4
  errorListMessages}from"./chunk-IF2K4PM5.js";import{LIST_FLAGS,LIST_PAGING_HELP,envelopePaging,nonEmpty,positiveInteger}from"./chunk-IOGMOXYF.js";import{requireResolved,singleRef,withResolved}from"./chunk-LXIAOCUW.js";import{acknowledgement,isRecord,pick}from"./chunk-VTQAI52S.js";import{ApiRejectedError,ApiResponseError,UsageError}from"./chunk-UFND7FBC.js";import fs from"fs";import path from"path";function levelForbidden(licenseGuidance,levelGuidance){return body=>body?.error==="permission_denied"?licenseGuidance:levelGuidance}var COMPANY_LICENSE="\u53D6\u5F15\u5148\u3092\u6271\u3046\u306B\u306F\u8CA9\u58F2\u7BA1\u7406\u304B\u9867\u5BA2\u7BA1\u7406\u306E\u6A29\u9650\u304C\u8981\u308A\u307E\u3059\u304C\u3001\u3069\u3061\u3089\u3082\u3042\u308A\u307E\u305B\u3093\u3002\u30C6\u30CA\u30F3\u30C8\u304C\u3069\u3061\u3089\u3082\u5951\u7D04\u3057\u3066\u3044\u306A\u3044\u304B\u3001\u3042\u306A\u305F\u306E\u6A29\u9650\u304C\u3069\u3061\u3089\u3082\u300C\u306A\u3057\u300D\u306B\u306A\u3063\u3066\u3044\u307E\u3059\u3002\u30C6\u30CA\u30F3\u30C8\u7BA1\u7406\u8005\u306B\u78BA\u8A8D\u3057\u3066\u304F\u3060\u3055\u3044\u3002";
5
5
  var CUSTOMER_LICENSE=featureLicenseGuidance("\u9867\u5BA2\u7BA1\u7406");var COMPANY_WRITE_FORBIDDEN=levelForbidden(COMPANY_LICENSE,"\u9867\u5BA2\u306E\u4F5C\u6210\u30FB\u66F4\u65B0\u306B\u306F\u3001\u9867\u5BA2\u7BA1\u7406\u306E\u6A29\u9650\u304C\u300C\u7DE8\u96C6\u8005\u300D\u4EE5\u4E0A\u304B\u3001\u8CA9\u58F2\u7BA1\u7406\u306E\u6A29\u9650\u304C\u300C\u30E1\u30F3\u30D0\u30FC\u300D\u4EE5\u4E0A\u306E\u3069\u3061\u3089\u304B\u304C\u8981\u308A\u307E\u3059\u3002\u30C6\u30CA\u30F3\u30C8\u7BA1\u7406\u8005\u306B\u78BA\u8A8D\u3057\u3066\u304F\u3060\u3055\u3044\u3002");
6
6
  var LEVEL_LABELS={admin:"\u7BA1\u7406\u8005",editor:"\u7DE8\u96C6\u8005",viewer:"\u95B2\u89A7\u8005",none:"\u306A\u3057"};var CHILD_DELETE_NEEDS="\u62C5\u5F53\u8005\u30FB\u5BFE\u5FDC\u5C65\u6B74\u306E\u524A\u9664\u306B\u306F\u9867\u5BA2\u7BA1\u7406\u306E\u6A29\u9650\u304C\u300C\u7BA1\u7406\u8005\u300D\u3067\u3042\u308B\u3053\u3068\u304C\u8981\u308A\u307E\u3059";var CUSTOMER_DELETE_FORBIDDEN=levelForbidden(COMPANY_LICENSE,"\u9867\u5BA2\u306E\u524A\u9664\u306B\u306F\u3001\u4F01\u696D\u306E\u524A\u9664\u306B\u9867\u5BA2\u7BA1\u7406\u306E\u300C\u7BA1\u7406\u8005\u300D\u304B\u8CA9\u58F2\u7BA1\u7406\u306E\u300C\u30E1\u30F3\u30D0\u30FC\u300D\u4EE5\u4E0A\u3001\u62C5\u5F53\u8005\u30FB\u5BFE\u5FDC\u5C65\u6B74\u306E\u524A\u9664\u306B\u9867\u5BA2\u7BA1\u7406\u306E\u300C\u7BA1\u7406\u8005\u300D\u304C\u8981\u308A\u307E\u3059\u3002\u30C6\u30CA\u30F3\u30C8\u7BA1\u7406\u8005\
@@ -1,6 +1,6 @@
1
1
  import { createRequire as __twpCreateRequire } from 'node:module';
2
2
  const require = __twpCreateRequire(import.meta.url);
3
- import{CommandModelMissingError,MAX_REPORTED_VIOLATIONS,loadCommandModelDomain,loadCommandModelIndex,validateBody,validateQuery}from"./chunk-NZ7WI4RZ.js";import{redactSecretValues,redactSecrets}from"./chunk-IOCNJMVW.js";import{isSafePathSegment}from"./chunk-GMBJTG6A.js";import{ApiError,TwpApiClient,appendQuery}from"./chunk-IF2K4PM5.js";import{DEFAULT_MAX_TOKENS,emptyUsage}from"./chunk-6QOT7CHX.js";import{isPrivateTwpHome,isTrustworthyCacheFile,writePrivateFileAtomic}from"./chunk-D233KKXW.js";
3
+ import{CommandModelMissingError,MAX_REPORTED_VIOLATIONS,loadCommandModelDomain,loadCommandModelIndex,validateBody,validateQuery}from"./chunk-NZ7WI4RZ.js";import{redactSecretValues,redactSecrets}from"./chunk-AUAZP2G7.js";import{isSafePathSegment}from"./chunk-GMBJTG6A.js";import{ApiError,TwpApiClient,appendQuery}from"./chunk-IF2K4PM5.js";import{DEFAULT_MAX_TOKENS,emptyUsage}from"./chunk-6QOT7CHX.js";import{isPrivateTwpHome,isTrustworthyCacheFile,writePrivateFileAtomic}from"./chunk-D233KKXW.js";
4
4
  import{AuthSession,NotLoggedInError,SessionExpiredError,withFileLock}from"./chunk-XNLIEUAW.js";import{MODES,applyPermissionMode,checkPermission,isModeId,setActiveModes}from"./chunk-NAUH75MM.js";import{isForceOnly,killProcessTree,system32}from"./chunk-N2UVRM3Z.js";import{findExecutable,isWindowsDriveAbsolute}from"./chunk-PMOUHEJQ.js";import{httpFetch}from"./chunk-J7QYPKVK.js";import{configReadDirs,ensureTwpHome,twpHomeDir}from"./chunk-RZVI6PMW.js";import{stripTerminalControls}from"./chunk-NHYMHCAT.js";import fs2 from"fs";import path3 from"path";import os2 from"os";import{realpathSync}from"fs";import{homedir}from"os";import{dirname,isAbsolute,relative,resolve,sep}from"path";var PathDeniedError=class extends Error{constructor(message){super(message);this.name="PathDeniedError"}};function resolveToolPath(input,cwd,home=homedir()){if(typeof input!=="string"||input.trim()===""){throw new PathDeniedError("path must be a non-empty string")}const expanded=expandHome(input,home);const abs=isAbsolute(expanded)?resolve(expanded):resolve(cwd,expanded);const root=realOrSelf(resolve(cwd));assertInside(abs,resolve(cwd),abs);assertNotSecret(abs,home);const real=realOrSelf(abs);if(real!==
5
5
  abs){assertInside(real,root,abs);assertNotSecret(real,home)}return abs}function realToolPath(input,cwd,home=homedir()){return realOrSelf(resolveToolPath(input,cwd,home))}function assertInside(target,root,reported){const rel=relative(root,target);const outside=rel===".."||rel.startsWith(`..${sep}`)||isAbsolute(rel);if(outside){throw new PathDeniedError(`path escapes the working directory (${reported}). Only paths under ${root} can be accessed.`)}}function realOrSelf(target){let current=target;const rest=[];
6
6
  for(;;){try{const real=realpathSync(current);return rest.length===0?real:resolve(real,...rest.reverse())}catch{const parent=dirname(current);if(parent===current)return target;rest.push(current.slice(parent.length+1));current=parent}}}function assertNotSecret(absPath,home=homedir(),env=process.env){const reason=secretReason(absPath,home,env);if(reason!==null)throw new PathDeniedError(`refusing to access ${absPath}: ${reason}`)}function secretReason(absPath,_home=homedir(),env=process.env){const lower=absPath.