@clavis.nexus/setup 1.0.2 → 2.0.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.
- package/README.md +65 -7
- package/dist/cli.js +1131 -445
- package/dist/cli.js.map +1 -1
- package/dist/index.d.ts +107 -11
- package/dist/index.js +825 -358
- package/dist/index.js.map +1 -1
- package/dist/mcp.js +1000 -428
- package/dist/mcp.js.map +1 -1
- package/package.json +5 -5
package/README.md
CHANGED
|
@@ -42,16 +42,21 @@ export CLAVIS_DEVELOPERS_ORIGIN=https://developers.clavis.nexus
|
|
|
42
42
|
|
|
43
43
|
clavis login
|
|
44
44
|
# ブラウザで Passkey 後、developers /setup/login に出る JSON を貼る
|
|
45
|
-
# (非対話: clavis login --bridge-json-file ./bridge.json
|
|
45
|
+
# (非対話: clavis login --bridge-json-file ./bridge.json。トークンは引数に載せない)
|
|
46
46
|
clavis status
|
|
47
|
-
clavis org-anchor-plan example.com "Example Org"
|
|
47
|
+
clavis org-anchor-plan example.com "Example Org" --incorporation JP --accept-customer-terms
|
|
48
48
|
# Passkey → org-anchor-finish → DNS 掲載 → org-verify-anchor
|
|
49
|
+
clavis org-verify-anchor --domain example.com --nonce <nonce> --incorporation JP --accept-customer-terms
|
|
49
50
|
clavis card-checkout <orgId>
|
|
51
|
+
# human.message の同意の文を顧客に見せ、同意を得てから
|
|
52
|
+
clavis card-checkout <orgId> --consent-billing-data
|
|
50
53
|
clavis app-register --org <orgId> --host app.example.com --name "My App"
|
|
51
54
|
clavis app-host-plan <orgId> <appId>
|
|
52
55
|
clavis app-verify-host <orgId> <appId>
|
|
53
56
|
clavis declaration-set --org <orgId> --app <appId> --end-users "社内利用者" --use signature="承認する"
|
|
54
57
|
clavis emit-env --app <appId>
|
|
58
|
+
# 任意: 新しい接続を受け付ける地域を絞る
|
|
59
|
+
clavis app-regions-set <orgId> <appId> --regions JP
|
|
55
60
|
```
|
|
56
61
|
|
|
57
62
|
`app-register` のあと、operate 秘密鍵は `~/.config/clavis/apps/<appId>/operate-private.jwk.json`(0600)に保存されます。CLI と MCP の JSON に載るのは、そのファイルパスです。
|
|
@@ -62,13 +67,66 @@ clavis emit-env --app <appId>
|
|
|
62
67
|
|
|
63
68
|
### ログイン(貼り付け)
|
|
64
69
|
|
|
65
|
-
ブラウザから localhost へトークンを POST しません。`clavis login` は developers `/developers/setup/login?state=…` を開き、画面の JSON(`state` + `accessToken`)を stdin または `--bridge-json
|
|
70
|
+
ブラウザから localhost へトークンを POST しません。`clavis login` は developers `/developers/setup/login?state=…` を開き、画面の JSON(`state` + `accessToken`)を stdin または `--bridge-json-file` で受け取ります。アクセストークンと operate 秘密鍵はコマンド引数に載せません。MCP の `clavis_login` は初回でブラウザを開き、2 回目に `bridge_json` を渡します。operate 鍵は `app-register` が書いたファイルから読みます。
|
|
71
|
+
|
|
72
|
+
### Org の作成(設立地と組織の契約)
|
|
73
|
+
|
|
74
|
+
`org-anchor-plan` と `org-verify-anchor` には、次の 2 つを渡します。MCP では `incorporation` と `accept_customer_terms` です。
|
|
75
|
+
|
|
76
|
+
- `--incorporation`: Org の設立地です。`JP`、`GB-EAW`(イングランド・ウェールズ)、EEA の国コード(例: `DE`)、`US-XX`(例: `US-DE`)のいずれかです。
|
|
77
|
+
- `--accept-customer-terms`: 顧客がこの Org について、組織の契約(Customer Terms)とデータ処理契約(DPA)に同意したことを示します。同意するかは顧客が決めます。同意を得てから渡してください。CLI も MCP も、既定で同意にはしません。エージェントは自分で付けず、人間に確かめます。無いときの応答には `needs_human: terms` が付きます。
|
|
78
|
+
|
|
79
|
+
いま新しく申告できない設立地(`GET /orgs/regions` の `closed_incorporations`)は、`org-anchor-plan` が Passkey の前に断ります。API が 403 `REGION_CLOSED` を返したときも、応答の `error` は `region_closed` で始まります。
|
|
80
|
+
|
|
81
|
+
### 設立地の申告し直し
|
|
82
|
+
|
|
83
|
+
組織の契約と DPA の版が新しくなったあと、購入の前に設立地を申告し直します。
|
|
84
|
+
|
|
85
|
+
```bash
|
|
86
|
+
clavis incorporation-set <orgId> --incorporation JP --accept-customer-terms
|
|
87
|
+
```
|
|
88
|
+
|
|
89
|
+
- 申告は、その時点の組織の契約と DPA の版に結ばれます。版が新しいと、`clavis status` の `incorporation.terms_current` が `false` です。
|
|
90
|
+
- 新しい版への同意になるため、`--accept-customer-terms` が要ります(MCP は `clavis_incorporation_set`)。
|
|
91
|
+
- 今の設立地のままの申告し直しは、その地域が閉じていても続けられます。
|
|
92
|
+
|
|
93
|
+
### 署名のカードの購入
|
|
94
|
+
|
|
95
|
+
Passkey のあと、署名のカードの Checkout をブラウザで開き、カードの入力は人間が行います。
|
|
96
|
+
|
|
97
|
+
```bash
|
|
98
|
+
clavis card-checkout <orgId>
|
|
99
|
+
# human.message の同意の文を顧客に見せ、同意を得てから
|
|
100
|
+
clavis card-checkout <orgId> --consent-billing-data
|
|
101
|
+
```
|
|
102
|
+
|
|
103
|
+
- 設立地が今の版で申告済みであることが要ります。足りないときの `error` は `incorporation_required` か `incorporation_stale` です。
|
|
104
|
+
- 決済と請求のため、Clavis アカウント識別子、Org ID と購入する機能、購入後の利用量(件数と日時)を、米国の Polar Software Inc. に提供します。この提供への顧客本人の同意が要ります。`--consent-billing-data` を付けずに実行すると、応答の `human.message`(`needs_human: terms`)に同意の文と組織の契約・DPA の版が出ます。顧客に見せ、同意を得てから `--consent-billing-data`(MCP: `consent_billing_data: true`)を付けて実行し直します。エージェントは自分で付けません。
|
|
105
|
+
- 同意の文は `--lang ja` で日本語です(既定は英語)。購入の記録は、見せた言語の文に結ばれます。
|
|
106
|
+
- 月額の束で購入するときは `--offer bundle` です。既定は従量(`meter`)です。
|
|
107
|
+
|
|
108
|
+
### App の受け入れる地域
|
|
109
|
+
|
|
110
|
+
App ごとに、新しい接続を受け付ける国・地域を絞れます。任意の設定です。
|
|
111
|
+
|
|
112
|
+
```bash
|
|
113
|
+
clavis app-regions-set <orgId> <appId> --regions JP,US
|
|
114
|
+
# Clavis が受け付ける地域すべてに戻す
|
|
115
|
+
clavis app-regions-set <orgId> <appId> --all
|
|
116
|
+
```
|
|
117
|
+
|
|
118
|
+
- 地域は `JP`、`US`、`GB`、`EEA` です。MCP は `clavis_app_regions_set` の `regions` か `all: true` です。
|
|
119
|
+
- 選べるのは、いま Clavis が受け付けている地域だけです(`GET /orgs/regions` の `app_regions`)。それ以外は Passkey の前に断り、`error` は `region_not_open` で始まります。
|
|
120
|
+
- 地域は接続元の国で判定します。国を判定できない接続は、選んだ地域の外として扱います。
|
|
121
|
+
- 絞っても、すでに接続している人はそのまま使えます。止めるのは、新しい同意、初めてのアプリ接続、アカウント連携、署名する人を決めていない署名です。
|
|
122
|
+
- 同じ地域がすでに保存されているときは、Passkey を開かずに `unchanged: true` を返します。
|
|
123
|
+
- 変えられるのは Org の owner と admin です。停止中の App は変えられません。
|
|
66
124
|
|
|
67
125
|
### この CLI が扱う範囲
|
|
68
126
|
|
|
69
|
-
- `clavis status` が返すのは、Org・App
|
|
70
|
-
- `clavis card-checkout` が開くのは、署名のカードの Checkout
|
|
71
|
-
- `declaration-set` の `--use` には `signature
|
|
127
|
+
- `clavis status` が返すのは、Org・App・ホスト確認・用途の申告と、App の受け入れる地域(絞ったときだけ `accepted_regions`)、署名のカードの状態(止めている理由は `signature_card_blockers`)、設立地です。台帳の購読は developers で確認します。
|
|
128
|
+
- `clavis card-checkout` が開くのは、署名のカードの Checkout です。台帳のカードは developers で購読します。
|
|
129
|
+
- `declaration-set` の `--use` には `signature` と `ledger` を渡せます。CLI は 1 回に 1 つで、その申告が前の申告を置き換えます。1 つの App で複数の機能を申告するときは、MCP の `uses` 配列か developers で書きます。
|
|
72
130
|
|
|
73
131
|
## ライブラリ
|
|
74
132
|
|
|
@@ -79,6 +137,6 @@ const setup = createSetupClient();
|
|
|
79
137
|
const status = await setup.status();
|
|
80
138
|
```
|
|
81
139
|
|
|
82
|
-
ツール応答に `needs_human: passkey | payment | dns | login`
|
|
140
|
+
ツール応答に `needs_human: passkey | payment | dns | login | terms` が付くときは、人間の操作が必要です。`terms` は、顧客が自分で決める同意(組織の契約、決済のためのデータ提供)の段階です。
|
|
83
141
|
|
|
84
142
|
署名依頼の登録と完了の読み取りは [`@clavis.nexus/app`](https://www.npmjs.com/package/@clavis.nexus/app) です。
|