@acosmi/sdk-ts 1.3.0 → 1.3.2

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.
@@ -80,6 +80,16 @@ await client.login('Read-only Compliance App', [
80
80
  Compliance scopes are independent from `ScopeAI`, `ScopeSkills`, and
81
81
  `ScopeAccount`. Holding the general scopes does not grant compliance access.
82
82
 
83
+ Report scopes are split by action:
84
+
85
+ - `ScopeComplianceReportsRead` — `getReport`, `downloadReport`.
86
+ - `ScopeComplianceReportsWrite` — `createReport`. This scope was added after the
87
+ initial release; tokens issued before it existed do **not** carry it. An app
88
+ that calls `createReport` must request `ScopeComplianceReportsWrite` at
89
+ `login()` time, and existing users must re-authorize (run the OAuth flow
90
+ again) so the new scope is granted.
91
+ - `ScopeComplianceReportsPublish` — `publishReport` (also requires step-up).
92
+
83
93
  ## Base URL
84
94
 
85
95
  `Client` keeps the existing model gateway path under `/api/v4`. Compliance uses
@@ -174,6 +184,13 @@ The public result includes stable evidence and hash fields only. It excludes PII
174
184
  contract originals, storage bucket/key values, subject snapshot IDs, provider raw
175
185
  payloads, and timestamp authority internals.
176
186
 
187
+ `verifyEvidencePublic` is anonymous-capable. It does not require `login()`: when no
188
+ token is available the SDK sends an anonymous request instead of throwing
189
+ `not authorized, call login() first`. When the client already holds a token the
190
+ request carries the `Authorization` header so the backend can keep audit context.
191
+ Unlike authenticated GET reads, public verification never triggers a token
192
+ refresh/replay on `401`.
193
+
177
194
  ## Signing And Provider Request Polling
178
195
 
179
196
  Signing envelope methods expose the Acosmi workflow state, not provider-specific
@@ -235,6 +252,25 @@ switch (info.key) {
235
252
  `CompliancePollError` is used by polling helpers for terminal failure, timeout,
236
253
  abort, and unknown states.
237
254
 
255
+ ## Method Status
256
+
257
+ Each `client.compliance.*` method has one of four maturity grades. Treat this
258
+ table as the contract — `gated` methods are expected to fail-closed until the
259
+ backend step-up / gate is opened, and the SDK never retries or fakes success
260
+ for them.
261
+
262
+ | Status | Methods | Meaning |
263
+ | --- | --- | --- |
264
+ | `production-ready` | `createEvidenceAsset`, `getEvidenceAsset`, `verifyEvidencePublic`, `issueTimestamp`, `issueTimestampForAsset`, `getTimestamp`, `verifyTimestamp`, `waitForTimestampVerified`, `buildEvidencePackage`, `createReport`, `getReport`, `downloadReport`, `createSigningEnvelope`, `getSigningEnvelope`, `syncSigningEnvelopeStatus`, `submitSealApproval`, `rejectSealApproval`, `cancelSealApproval`, `listPendingSealApprovals`, `getSealApproval`, `getProviderRequest`, `waitForProviderRequestTerminal`, `classifyError` | Backend endpoint, scope, DTO contract, SDK tests and docs are all closed. Safe to call in production. |
265
+ | `gated` | `publishReport`, `signEnvelope`, `createH5SigningUrl`, `approveSealApproval` | SDK exposes the method, but the backend fails-closed (`COMPLIANCE_STEP_UP_REQUIRED` / `ENVELOPE_GATE_CLOSED`) until step-up and the W3 gate chain are ready. The SDK does not retry and does not fake success — surface the typed error as "feature not yet open". |
266
+ | `draft contract` | operation views, gate-status views, binary download helpers | Type drafts only — not exposed as callable capability in this release. |
267
+ | `internal-only` | distribution billing (`reserve` / `commit` / `cancel` / `reconcile` / `refund`), provider raw payloads, provider callbacks, CFCA controlled materials | Server-side S2S only. Never part of the SDK call surface; no SDK method exists for these. |
268
+
269
+ `submitSealApproval` is `production-ready`: the backend enforces
270
+ `Idempotency-Key` + business-fingerprint replay protection, so a repeated submit
271
+ with the same key returns the original approval id instead of creating a
272
+ duplicate. Persist the idempotency key on the caller side.
273
+
238
274
  ## Safety Boundary
239
275
 
240
276
  Do not place any of the following in SDK code, tests, examples, docs, git
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@acosmi/sdk-ts",
3
- "version": "1.3.0",
4
- "description": "Acosmi 模型网关与 Agent Run Gateway TypeScript SDK 双格式 (Anthropic + OpenAI) 多端 (浏览器 / Node ≥18 / Deno / Bun)。",
3
+ "version": "1.3.2",
4
+ "description": "Acosmi TypeScript SDK:模型网关、Agent Run Gateway Compliance(电子证据、时间章、报告、签署 envelope)统一客户端,支持浏览器 / Node ≥18 / Deno / Bun。",
5
5
  "type": "module",
6
6
  "main": "./dist/node/index.cjs",
7
7
  "module": "./dist/node/index.mjs",
@@ -55,6 +55,10 @@
55
55
  "openai",
56
56
  "llm",
57
57
  "sdk",
58
+ "compliance",
59
+ "evidence",
60
+ "timestamp",
61
+ "esignature",
58
62
  "claude",
59
63
  "crabcode",
60
64
  "crabclaw"