codai-sdk 0.66.0 → 0.67.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/dist/index.d.ts +461 -6
- package/dist/index.js +64 -2
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -3036,6 +3036,10 @@ var VoiceRevocations = class {
|
|
|
3036
3036
|
|
|
3037
3037
|
//#endregion
|
|
3038
3038
|
//#region src/resources/vault.ts
|
|
3039
|
+
/** The UTF-8 message an unlock proof covers: `codai-vault/unlock/v1|<challenge>|<device_id or "passkey">`. */
|
|
3040
|
+
function vaultUnlockMessage(challenge, deviceIdOrPasskey) {
|
|
3041
|
+
return `codai-vault/unlock/v1|${challenge}|${deviceIdOrPasskey}`;
|
|
3042
|
+
}
|
|
3039
3043
|
const seg = (base, id, suffix = "") => `${base}/${encodeURIComponent(id)}${suffix}`;
|
|
3040
3044
|
/** `/v1/vault/devices/*` — hardware-backed device approval keys (public keys only; revocation is instant). */
|
|
3041
3045
|
var VaultDevices = class {
|
|
@@ -3124,6 +3128,53 @@ var Vault = class {
|
|
|
3124
3128
|
setDefaultTier(defaultTier, opts = {}) {
|
|
3125
3129
|
return this.send("PATCH", "/v1/vault/settings", opts, { default_tier: defaultTier });
|
|
3126
3130
|
}
|
|
3131
|
+
/**
|
|
3132
|
+
* `PATCH /v1/vault/settings` — `default_tier` and/or partial anomaly `guards` (merged over the current ones).
|
|
3133
|
+
* Answers the effective `{ default_tier, guards }`.
|
|
3134
|
+
*/
|
|
3135
|
+
updateSettings(body, opts = {}) {
|
|
3136
|
+
if (body.default_tier === void 0 && body.guards === void 0) return Promise.reject(/* @__PURE__ */ new TypeError("updateSettings needs default_tier and/or guards"));
|
|
3137
|
+
return this.send("PATCH", "/v1/vault/settings", opts, { ...body });
|
|
3138
|
+
}
|
|
3139
|
+
/**
|
|
3140
|
+
* `POST /v1/vault/lock` — panic: revoke every live grant, deny every pending approval, lock the vault (agent uses
|
|
3141
|
+
* then answer `vault_locked`). Device keys stay enrolled. Idempotent.
|
|
3142
|
+
*/
|
|
3143
|
+
lock(params = {}, opts = {}) {
|
|
3144
|
+
return this.send("POST", "/v1/vault/lock", opts, { via: params.via });
|
|
3145
|
+
}
|
|
3146
|
+
/** `POST /v1/vault/unlock/challenge` — single-use unlock challenge, valid 5 minutes. */
|
|
3147
|
+
unlockChallenge(opts = {}) {
|
|
3148
|
+
return this.send("POST", "/v1/vault/unlock/challenge", opts, {});
|
|
3149
|
+
}
|
|
3150
|
+
/**
|
|
3151
|
+
* `POST /v1/vault/unlock` — end a lock with a device-key proof over {@link vaultUnlockMessage} or a passkey whose
|
|
3152
|
+
* challenge is base64url(SHA-256(that message with `passkey`)). 403 `challenge_invalid`, `wear_t3_only`, …
|
|
3153
|
+
*/
|
|
3154
|
+
unlock(body, opts = {}) {
|
|
3155
|
+
return this.send("POST", "/v1/vault/unlock", opts, { ...body });
|
|
3156
|
+
}
|
|
3157
|
+
/** `GET /v1/vault/limits` — per-handle usage caps on your items. */
|
|
3158
|
+
async limits(opts = {}) {
|
|
3159
|
+
return [...(await this.get("/v1/vault/limits", opts)).limits];
|
|
3160
|
+
}
|
|
3161
|
+
/**
|
|
3162
|
+
* `PUT /v1/vault/items/{id}/limits` — all three keys required; `null` removes a cap, all `null` removes the limits
|
|
3163
|
+
* (answers `null`). Over a cap the broker calls answer 429 `vault_rate_limited` with `Retry-After`.
|
|
3164
|
+
*/
|
|
3165
|
+
async setLimits(id, limits, opts = {}) {
|
|
3166
|
+
return (await this.http.json(seg("/v1/vault/items", id, "/limits"), {
|
|
3167
|
+
method: "PUT",
|
|
3168
|
+
body: {
|
|
3169
|
+
per_minute: limits.per_minute,
|
|
3170
|
+
per_day: limits.per_day,
|
|
3171
|
+
units_per_day: limits.units_per_day
|
|
3172
|
+
},
|
|
3173
|
+
ext: opts.ext,
|
|
3174
|
+
signal: opts.signal,
|
|
3175
|
+
noRetry: true
|
|
3176
|
+
})).limits ?? null;
|
|
3177
|
+
}
|
|
3127
3178
|
/** `GET /v1/vault/vaults` — vaults you belong to, with your role and sealed vault key. */
|
|
3128
3179
|
vaults(opts = {}) {
|
|
3129
3180
|
return this.get("/v1/vault/vaults", opts);
|
|
@@ -3174,6 +3225,10 @@ var Vault = class {
|
|
|
3174
3225
|
revokeGrant(id, opts = {}) {
|
|
3175
3226
|
return this.send("DELETE", seg("/v1/vault/grants", id), opts);
|
|
3176
3227
|
}
|
|
3228
|
+
/** `POST /v1/vault/grants/revoke-task` — revoke every live grant of a task / session; answers `{ revoked }`. */
|
|
3229
|
+
revokeTaskGrants(task, opts = {}) {
|
|
3230
|
+
return this.send("POST", "/v1/vault/grants/revoke-task", opts, { task });
|
|
3231
|
+
}
|
|
3177
3232
|
/** `GET /v1/vault/events` — append-only audit log (never contains secret values). */
|
|
3178
3233
|
events(params = {}, opts = {}) {
|
|
3179
3234
|
return this.get("/v1/vault/events", opts, { limit: params.limit });
|
|
@@ -6354,7 +6409,13 @@ const OPERATION_METHODS = {
|
|
|
6354
6409
|
createVoiceRevocation: "voiceRevocations.create",
|
|
6355
6410
|
getVaultAccount: "vault.account",
|
|
6356
6411
|
putVaultAccount: "vault.putAccount",
|
|
6357
|
-
patchVaultSettings: "vault.
|
|
6412
|
+
patchVaultSettings: "vault.updateSettings",
|
|
6413
|
+
lockVault: "vault.lock",
|
|
6414
|
+
createVaultUnlockChallenge: "vault.unlockChallenge",
|
|
6415
|
+
unlockVault: "vault.unlock",
|
|
6416
|
+
listVaultLimits: "vault.limits",
|
|
6417
|
+
setVaultItemLimits: "vault.setLimits",
|
|
6418
|
+
revokeVaultTaskGrants: "vault.revokeTaskGrants",
|
|
6358
6419
|
listVaults: "vault.vaults",
|
|
6359
6420
|
createVault: "vault.createVault",
|
|
6360
6421
|
listVaultItems: "vault.items",
|
|
@@ -6869,6 +6930,7 @@ var CodaiApps = class {
|
|
|
6869
6930
|
* client.voiceRevocations.create (public takedown ticket for a voice cloned in codai Studio; no key needed)
|
|
6870
6931
|
* client.vault.account / .items / .putItem / .rules / .approvals / .decide / .catalog / .use / .httpCall / .resolve
|
|
6871
6932
|
* client.vault.devices.challenge / .enroll / .list / .rename / .revoke (device approval keys, V-27)
|
|
6933
|
+
* client.vault.updateSettings / .lock / .unlockChallenge / .unlock / .limits / .setLimits / .revokeTaskGrants (guards, v4)
|
|
6872
6934
|
* (zero-knowledge credentials vault: ciphertext only; the broker calls never return secret values)
|
|
6873
6935
|
* client.abuseReports.create (public DSA notice about a codai Studio share / review link; no key needed)
|
|
6874
6936
|
* client.provenance.check (public: which codai AI-provenance marks a file carries; no key needed)
|
|
@@ -7165,5 +7227,5 @@ function allKeys(obj) {
|
|
|
7165
7227
|
}
|
|
7166
7228
|
|
|
7167
7229
|
//#endregion
|
|
7168
|
-
export { AbuseReports, Account, AgentRuns, Agents, Assets, Audio, Batches, Billing, BrandKits, Cards, Chat, ChatCompletions, Codai, Codai as default, CodaiApps, CodaiError, Creatives, Devices, Documents, Embeddings, EnvironmentFiles, EnvironmentJobs, EnvironmentMembers, EnvironmentPorts, EnvironmentSecrets, EnvironmentTasks, Environments, Exports, Feedback, Health, Heartbeats, Hosts, HttpClient, Images, Keys, Lists, Memory, Messages, Models, Music, Notifications, OPERATION_METHODS, OrgMembers, Orgs, OsGate, PROVENANCE_MAX_BYTES, PhoneModels, Productions, Projects, Prompts, Provenance, RESOLVE_ATTESTATION_PAYLOAD_TYPE, RESOLVE_OPERATION_METHODS, RESOLVE_TERMINAL_STATUSES, Realtime, RealtimeSession, Receipts, Referrals, Renders, Research, Resolve, ResolveError, ResolveInsufficientFundsError, Responses, STREAMING_OPERATIONS, SandboxFiles, Sandboxes, ScheduleExecutor, SchedulerHosts, Schedules, SessionControls, SessionEvents, SessionLease, SessionShares, Sessions, Settings, Sfx, Shares, SystemOne, TUS_CHUNK_BYTES, Tasks, Templates, Tokens, Tools, Transcripts, Triggers, Usage, Vault, VaultDevices, Verify, Videos, VoiceRevocations, extensionHeaders, frameJson, isAssetDto, isProductionFinished, isResearchFinished, mergeToolCall, readSse, realtimeUrl, resolveAttestationStatement, settingsConflictCurrent, shareTokenFrom, uploadIdFromLocation, verifyAttestationWithKeys, verifyResolveWebhook };
|
|
7230
|
+
export { AbuseReports, Account, AgentRuns, Agents, Assets, Audio, Batches, Billing, BrandKits, Cards, Chat, ChatCompletions, Codai, Codai as default, CodaiApps, CodaiError, Creatives, Devices, Documents, Embeddings, EnvironmentFiles, EnvironmentJobs, EnvironmentMembers, EnvironmentPorts, EnvironmentSecrets, EnvironmentTasks, Environments, Exports, Feedback, Health, Heartbeats, Hosts, HttpClient, Images, Keys, Lists, Memory, Messages, Models, Music, Notifications, OPERATION_METHODS, OrgMembers, Orgs, OsGate, PROVENANCE_MAX_BYTES, PhoneModels, Productions, Projects, Prompts, Provenance, RESOLVE_ATTESTATION_PAYLOAD_TYPE, RESOLVE_OPERATION_METHODS, RESOLVE_TERMINAL_STATUSES, Realtime, RealtimeSession, Receipts, Referrals, Renders, Research, Resolve, ResolveError, ResolveInsufficientFundsError, Responses, STREAMING_OPERATIONS, SandboxFiles, Sandboxes, ScheduleExecutor, SchedulerHosts, Schedules, SessionControls, SessionEvents, SessionLease, SessionShares, Sessions, Settings, Sfx, Shares, SystemOne, TUS_CHUNK_BYTES, Tasks, Templates, Tokens, Tools, Transcripts, Triggers, Usage, Vault, VaultDevices, Verify, Videos, VoiceRevocations, extensionHeaders, frameJson, isAssetDto, isProductionFinished, isResearchFinished, mergeToolCall, readSse, realtimeUrl, resolveAttestationStatement, settingsConflictCurrent, shareTokenFrom, uploadIdFromLocation, vaultUnlockMessage, verifyAttestationWithKeys, verifyResolveWebhook };
|
|
7169
7231
|
//# sourceMappingURL=index.js.map
|