@clavis.nexus/setup 3.0.2 → 3.0.3

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 CHANGED
@@ -102,7 +102,7 @@ clavis card-checkout <orgId> --consent-billing-data
102
102
  ```
103
103
 
104
104
  - The place of incorporation must already be declared against the current versions. When it is missing, `error` is `incorporation_required` or `incorporation_stale`.
105
- - Payment and billing need the customer's own consent to provide their Clavis account identifier, the Org ID, the feature being purchased, and, after purchase, usage of that feature (counts and times) to Polar Software Inc. in the United States. Run the command once without `--consent-billing-data`. The response's `human.message` (`needs_human: terms`) carries the consent statement and the Customer Terms and DPA versions. Show that statement to the customer, and run again with `--consent-billing-data` (MCP: `consent_billing_data: true`) only after they consent. An agent does not set the flag itself.
105
+ - Payment and billing need the customer's own consent before checkout continues. Run the command once without `--consent-billing-data`. The response's `human.message` (`needs_human: terms`) carries the consent statement and the Customer Terms and DPA versions. Show that statement to the customer, and run again with `--consent-billing-data` (MCP: `consent_billing_data: true`) only after they consent. An agent does not set the flag itself.
106
106
  - `--lang ja` shows the consent statement in Japanese (the default is English). The purchase record is tied to the statement in the language that was shown.
107
107
  - `--offer bundle` buys the monthly bundle. The default is metered (`meter`).
108
108
 
@@ -123,6 +123,49 @@ clavis app-regions-set <orgId> <appId> --all
123
123
  - When the same regions are already saved, the command returns `unchanged: true` and does not open a passkey.
124
124
  - An Org owner or admin can change the list. A stopped app cannot be changed.
125
125
 
126
+ ### Agreements
127
+
128
+ What Connect shows when your app asks a user for an agreement comes from the app's agreement profile. Have Clavis snapshot your terms and privacy notice first, then set the profile with a passkey.
129
+
130
+ ```bash
131
+ clavis app-lex-document <orgId> <appId> --url https://app.example.com/terms
132
+ # put the sha256 it returns in the profile's documents
133
+ clavis app-lex-profile-set <orgId> <appId> --file profile.json
134
+ # remove it
135
+ clavis app-lex-profile-set <orgId> <appId> --clear
136
+ ```
137
+
138
+ - Clavis reads and normalises the profile, and returns the statement to sign (`org.app.lex_profile@1`). The CLI opens the passkey with that statement, then sets the same profile with the receipt. In MCP, use `clavis_app_lex_document` and `clavis_app_lex_profile_set`.
139
+ - A document not snapshotted first is refused before the passkey (`error` starts with `document_not_snapshotted`).
140
+
141
+ For a new App, add `--agreements` to `clavis app-register`, or set `agreements: true` in `clavis_app_register`.
142
+
143
+ ### Exporting agreement records
144
+
145
+ ```bash
146
+ clavis lex-counts <orgId> --query-file query.json
147
+ clavis lex-export <orgId> --request-file request.json
148
+ clavis lex-export-status <orgId> <jobId>
149
+ clavis lex-export-download <orgId> <jobId> --dir ./exports
150
+ ```
151
+
152
+ - `request.json` is `{ "kind": "decisions" | "subject", "query": { ... }, "expiring_within_days": N, "records": true }`. `query` narrows by `from` and `to` (the period), `app_id`, `use_case`, `outcome`, `reason_code`, `pack_id`, `template`, `requirement`, `profile_version` and `params_version`. `expiring_within_days` keeps only records whose retention ends within that many days, so you can keep them yourself.
153
+ - Many people's records (`decisions`) need an owner's or admin's passkey over the request. One person's (`subject`, with `query.subject_ref`) does not. One export runs at a time, and holds up to 100,000 decisions.
154
+ - `lex-export-download` writes the files at mode 0600 under `<dir>/<jobId>/` — they hold people's records — after checking each file against the manifest and the manifest against the digest in the authenticated export status. An export is kept for 7 days.
155
+ - In MCP: `clavis_lex_counts`, `clavis_lex_export`, `clavis_lex_exports`, `clavis_lex_export_status` and `clavis_lex_export_download`.
156
+
157
+ ### One person's agreement records
158
+
159
+ ```bash
160
+ clavis lex-decision <orgId> <decisionId>
161
+ clavis lex-subject-decisions <orgId> <subject>
162
+ clavis lex-subject-erase <orgId> <subject>
163
+ ```
164
+
165
+ - `subject` is the person's ID in your app (the `sub` you passed as `allowedSub`). `lex-decision` takes the `decisionId` your app received when the agreement completed.
166
+ - `lex-subject-erase` erases that person's decisions now, as your organisation's instruction for their erasure request. It needs an owner's or admin's passkey and cannot be undone. The leaves on your ledger stay and no longer lead to anything. While the records are under a hold, it is refused (`error` starts with `org_hold`) and nothing is erased.
167
+ - In MCP: `clavis_lex_decision`, `clavis_lex_subject_decisions` and `clavis_lex_subject_erase`.
168
+
126
169
  ### What this CLI covers
127
170
 
128
171
  - `clavis status` returns the Org, apps, host confirmation, the use declaration, the app's accepted regions (`accepted_regions` only when the list is narrowed), the signature card (`signature_card_blockers` is what holds it back) and the place of incorporation. Check the ledger subscription on developers.