@run402/sdk 4.93.2 → 4.94.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 +21 -19
- package/core-dist/config.d.ts +16 -2
- package/core-dist/config.js +52 -18
- package/core-dist/control-plane-session.d.ts +29 -14
- package/core-dist/control-plane-session.js +31 -6
- package/core-dist/keystore.js +7 -7
- package/core-dist/profiles.d.ts +3 -3
- package/core-dist/profiles.js +9 -7
- package/core-dist/{allowance-auth.d.ts → wallet-auth.d.ts} +6 -6
- package/core-dist/{allowance-auth.js → wallet-auth.js} +15 -15
- package/core-dist/wallet.d.ts +22 -0
- package/core-dist/{allowance.js → wallet.js} +20 -20
- package/core-dist/{write-auth-session.d.ts → write-approvals.d.ts} +28 -26
- package/core-dist/{write-auth-session.js → write-approvals.js} +19 -19
- package/dist/actions.d.ts +1 -1
- package/dist/actions.d.ts.map +1 -1
- package/dist/control-plane-credentials.d.ts +8 -8
- package/dist/control-plane-credentials.js +7 -7
- package/dist/credentials.d.ts +19 -19
- package/dist/credentials.d.ts.map +1 -1
- package/dist/credentials.js +1 -1
- package/dist/errors.d.ts +24 -26
- package/dist/errors.d.ts.map +1 -1
- package/dist/errors.js +34 -37
- package/dist/errors.js.map +1 -1
- package/dist/index.d.ts +29 -16
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +29 -16
- package/dist/index.js.map +1 -1
- package/dist/kernel.d.ts +1 -1
- package/dist/kernel.d.ts.map +1 -1
- package/dist/kernel.js +10 -9
- package/dist/kernel.js.map +1 -1
- package/dist/namespaces/admin.d.ts +51 -120
- package/dist/namespaces/admin.d.ts.map +1 -1
- package/dist/namespaces/admin.js +41 -45
- package/dist/namespaces/admin.js.map +1 -1
- package/dist/namespaces/agent.d.ts +2 -2
- package/dist/namespaces/agent.d.ts.map +1 -1
- package/dist/namespaces/agent.js +2 -2
- package/dist/namespaces/agent.js.map +1 -1
- package/dist/namespaces/ai.d.ts +1 -1
- package/dist/namespaces/ai.js +1 -1
- package/dist/namespaces/billing.d.ts +6 -3
- package/dist/namespaces/billing.d.ts.map +1 -1
- package/dist/namespaces/billing.js.map +1 -1
- package/dist/namespaces/buzz-notifications.types.d.ts +1 -1
- package/dist/namespaces/buzz.d.ts +2 -2
- package/dist/namespaces/buzz.d.ts.map +1 -1
- package/dist/namespaces/buzz.js +2 -2
- package/dist/namespaces/buzz.js.map +1 -1
- package/dist/namespaces/buzz.types.d.ts +2 -2
- package/dist/namespaces/buzz.types.d.ts.map +1 -1
- package/dist/namespaces/credentials.types.d.ts +1 -1
- package/dist/namespaces/deploy.d.ts +1 -1
- package/dist/namespaces/deploy.js +5 -5
- package/dist/namespaces/deploy.js.map +1 -1
- package/dist/namespaces/deploy.types.d.ts +4 -4
- package/dist/namespaces/escalations.d.ts +1 -1
- package/dist/namespaces/escalations.js +1 -1
- package/dist/namespaces/escalations.types.d.ts +2 -2
- package/dist/namespaces/escalations.types.d.ts.map +1 -1
- package/dist/namespaces/events.types.d.ts +1 -1
- package/dist/namespaces/functions.d.ts +1 -1
- package/dist/namespaces/functions.js +1 -1
- package/dist/namespaces/gitvault.crypto.d.ts +1 -1
- package/dist/namespaces/gitvault.d.ts +24 -24
- package/dist/namespaces/gitvault.d.ts.map +1 -1
- package/dist/namespaces/gitvault.js +109 -109
- package/dist/namespaces/gitvault.js.map +1 -1
- package/dist/namespaces/me.d.ts +120 -0
- package/dist/namespaces/me.d.ts.map +1 -0
- package/dist/namespaces/me.js +34 -0
- package/dist/namespaces/me.js.map +1 -0
- package/dist/namespaces/org.d.ts +108 -6
- package/dist/namespaces/org.d.ts.map +1 -1
- package/dist/namespaces/org.js +63 -7
- package/dist/namespaces/org.js.map +1 -1
- package/dist/namespaces/org.types.d.ts +29 -9
- package/dist/namespaces/org.types.d.ts.map +1 -1
- package/dist/namespaces/pay.js +3 -3
- package/dist/namespaces/pay.js.map +1 -1
- package/dist/namespaces/projects.d.ts +9 -9
- package/dist/namespaces/projects.js +15 -15
- package/dist/namespaces/projects.js.map +1 -1
- package/dist/namespaces/projects.types.d.ts +28 -12
- package/dist/namespaces/projects.types.d.ts.map +1 -1
- package/dist/namespaces/rooms.d.ts +7 -7
- package/dist/namespaces/rooms.js +17 -17
- package/dist/namespaces/rooms.js.map +1 -1
- package/dist/namespaces/rooms.types.d.ts +9 -9
- package/dist/namespaces/rooms.types.d.ts.map +1 -1
- package/dist/namespaces/service.d.ts +1 -1
- package/dist/namespaces/service.js +1 -1
- package/dist/namespaces/{operator-session.d.ts → session.d.ts} +135 -51
- package/dist/namespaces/session.d.ts.map +1 -0
- package/dist/namespaces/{operator-session.js → session.js} +118 -30
- package/dist/namespaces/session.js.map +1 -0
- package/dist/namespaces/subdomains.d.ts +5 -5
- package/dist/namespaces/subdomains.d.ts.map +1 -1
- package/dist/namespaces/subdomains.js +6 -6
- package/dist/namespaces/subdomains.js.map +1 -1
- package/dist/namespaces/tier.d.ts +43 -20
- package/dist/namespaces/tier.d.ts.map +1 -1
- package/dist/namespaces/tier.js +7 -7
- package/dist/namespaces/tier.js.map +1 -1
- package/dist/namespaces/transfers.d.ts +74 -71
- package/dist/namespaces/transfers.d.ts.map +1 -1
- package/dist/namespaces/transfers.js +31 -38
- package/dist/namespaces/transfers.js.map +1 -1
- package/dist/namespaces/vouchers.d.ts +9 -10
- package/dist/namespaces/vouchers.d.ts.map +1 -1
- package/dist/namespaces/vouchers.js +4 -5
- package/dist/namespaces/vouchers.js.map +1 -1
- package/dist/namespaces/wallets.d.ts +72 -3
- package/dist/namespaces/wallets.d.ts.map +1 -1
- package/dist/namespaces/wallets.js +141 -3
- package/dist/namespaces/wallets.js.map +1 -1
- package/dist/namespaces/write-approval.d.ts +101 -0
- package/dist/namespaces/write-approval.d.ts.map +1 -0
- package/dist/namespaces/write-approval.js +62 -0
- package/dist/namespaces/write-approval.js.map +1 -0
- package/dist/node/actions-node.d.ts +3 -3
- package/dist/node/actions-node.d.ts.map +1 -1
- package/dist/node/actions-node.js +36 -36
- package/dist/node/actions-node.js.map +1 -1
- package/dist/node/{bearer-claim-key.d.ts → bearer-redeem-key.d.ts} +12 -12
- package/dist/node/bearer-redeem-key.d.ts.map +1 -0
- package/dist/node/{bearer-claim-key.js → bearer-redeem-key.js} +21 -21
- package/dist/node/bearer-redeem-key.js.map +1 -0
- package/dist/node/ci.d.ts +1 -1
- package/dist/node/ci.d.ts.map +1 -1
- package/dist/node/ci.js +6 -6
- package/dist/node/ci.js.map +1 -1
- package/dist/node/credentials.d.ts +17 -16
- package/dist/node/credentials.d.ts.map +1 -1
- package/dist/node/credentials.js +28 -27
- package/dist/node/credentials.js.map +1 -1
- package/dist/node/funding-recovery.d.ts +1 -1
- package/dist/node/funding-recovery.d.ts.map +1 -1
- package/dist/node/funding-recovery.js +1 -1
- package/dist/node/funding-recovery.js.map +1 -1
- package/dist/node/gitvault-apply.d.ts +1 -1
- package/dist/node/gitvault-apply.d.ts.map +1 -1
- package/dist/node/gitvault-handoff.d.ts +22 -22
- package/dist/node/gitvault-handoff.d.ts.map +1 -1
- package/dist/node/gitvault-handoff.js +45 -45
- package/dist/node/gitvault-handoff.js.map +1 -1
- package/dist/node/gitvault-prewarm.js +7 -7
- package/dist/node/gitvault-prewarm.js.map +1 -1
- package/dist/node/gitvault-restore.d.ts +1 -1
- package/dist/node/gitvault-restore.js +1 -1
- package/dist/node/index.d.ts +16 -16
- package/dist/node/index.d.ts.map +1 -1
- package/dist/node/index.js +15 -15
- package/dist/node/index.js.map +1 -1
- package/dist/node/org-adopt.d.ts +49 -0
- package/dist/node/org-adopt.d.ts.map +1 -0
- package/dist/node/org-adopt.js +77 -0
- package/dist/node/org-adopt.js.map +1 -0
- package/dist/node/paid-fetch.d.ts +7 -7
- package/dist/node/paid-fetch.d.ts.map +1 -1
- package/dist/node/paid-fetch.js +54 -54
- package/dist/node/paid-fetch.js.map +1 -1
- package/dist/node/preflight.d.ts +1 -1
- package/dist/node/preflight.d.ts.map +1 -1
- package/dist/node/preflight.js +1 -1
- package/dist/node/preflight.js.map +1 -1
- package/dist/node/source-scan.d.ts +1 -1
- package/dist/node/source-scan.js +2 -2
- package/dist/node/source-scan.js.map +1 -1
- package/dist/scoped.d.ts +3 -3
- package/dist/scoped.d.ts.map +1 -1
- package/dist/scoped.js +2 -2
- package/dist/scoped.js.map +1 -1
- package/package.json +1 -1
- package/core-dist/allowance.d.ts +0 -22
- package/core-dist/operator-session.d.ts +0 -80
- package/core-dist/operator-session.js +0 -154
- package/dist/namespaces/allowance.d.ts +0 -79
- package/dist/namespaces/allowance.d.ts.map +0 -1
- package/dist/namespaces/allowance.js +0 -149
- package/dist/namespaces/allowance.js.map +0 -1
- package/dist/namespaces/operator-session.d.ts.map +0 -1
- package/dist/namespaces/operator-session.js.map +0 -1
- package/dist/namespaces/operator.d.ts +0 -359
- package/dist/namespaces/operator.d.ts.map +0 -1
- package/dist/namespaces/operator.js +0 -272
- package/dist/namespaces/operator.js.map +0 -1
- package/dist/node/bearer-claim-key.d.ts.map +0 -1
- package/dist/node/bearer-claim-key.js.map +0 -1
- package/dist/node/operator-claim.d.ts +0 -49
- package/dist/node/operator-claim.d.ts.map +0 -1
- package/dist/node/operator-claim.js +0 -77
- package/dist/node/operator-claim.js.map +0 -1
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
*
|
|
5
5
|
* Exposed as `r.admin.transfers.*`. Project transfer is ONE capability,
|
|
6
6
|
* body-discriminated by recipient kind: a wallet recipient (`toWallet`, SIWX
|
|
7
|
-
* bilateral signing), an email recipient (`toEmail`, the recipient
|
|
7
|
+
* bilateral signing), an email recipient (`toEmail`, the recipient accepts into
|
|
8
8
|
* an org), or an owned org recipient (`toOrgId`, same-actor org move). All ride
|
|
9
9
|
* the same `/transfers` surface — there is no separate `/handoffs` noun (the
|
|
10
10
|
* gateway removed it in `unify-project-transfer-surface`).
|
|
@@ -14,16 +14,19 @@
|
|
|
14
14
|
* GET /agent/v1/transfers/incoming — inbox (pending kinds, unioned)
|
|
15
15
|
* GET /agent/v1/transfers/outgoing — outbox (pending kinds, unioned)
|
|
16
16
|
* GET /agent/v1/transfers/:transfer_id — preview (kind-agnostic)
|
|
17
|
-
* POST /agent/v1/transfers/:transfer_id/accept —
|
|
18
|
-
*
|
|
17
|
+
* POST /agent/v1/transfers/:transfer_id/accept — the ONE completion; the row's recipient kind
|
|
18
|
+
* picks the credential (wallet: to_wallet's SIWX;
|
|
19
|
+
* email: a principal whose verified email matches,
|
|
20
|
+
* body { org_id?, accept_retained_member? })
|
|
19
21
|
* POST /agent/v1/transfers/:transfer_id/cancel — cancel (kind-agnostic)
|
|
20
22
|
*
|
|
21
23
|
* Owner-side mutations against a project with a pending transfer return
|
|
22
24
|
* 409 `PROJECT_HAS_PENDING_TRANSFER`. The SDK kernel surfaces that as
|
|
23
|
-
* {@link TransferFreezeError} so agents can guide the user to cancel.
|
|
24
|
-
* the wrong
|
|
25
|
-
* 409 `WRONG_COMPLETION_FOR_TRANSFER_KIND`; the
|
|
26
|
-
*
|
|
25
|
+
* {@link TransferFreezeError} so agents can guide the user to cancel. Accepting
|
|
26
|
+
* with the wrong credential for a row's kind (e.g. a wallet signature on an
|
|
27
|
+
* email-addressed row) returns 409 `WRONG_COMPLETION_FOR_TRANSFER_KIND`; the
|
|
28
|
+
* thrown error exposes an `accept_transfer` next action naming the credential
|
|
29
|
+
* the row needs, on the SAME `transfer_id`.
|
|
27
30
|
*/
|
|
28
31
|
import type { OperationActorSnapshot, PrincipalRepresentation } from "./identity-links.types.js";
|
|
29
32
|
import type { Client } from "../kernel.js";
|
|
@@ -58,13 +61,13 @@ export interface InitiateWalletTransferInput {
|
|
|
58
61
|
/** Optional KySigned record id (Phase 1A: informational only, stored verbatim, not verified). */
|
|
59
62
|
kysignedRecordId?: string;
|
|
60
63
|
/** Retention is an email-only opt-in; not allowed on the wallet path. */
|
|
61
|
-
|
|
64
|
+
retainMember?: never;
|
|
62
65
|
}
|
|
63
|
-
/** Initiate a transfer addressed to an email (the recipient
|
|
66
|
+
/** Initiate a transfer addressed to an email (the recipient accepts into an org via `accept`). */
|
|
64
67
|
export interface InitiateEmailTransferInput {
|
|
65
68
|
/** Project id to transfer. Caller must currently own/admin it. */
|
|
66
69
|
projectId: string;
|
|
67
|
-
/** Recipient email;
|
|
70
|
+
/** Recipient email; accepted by a principal whose verified email matches. */
|
|
68
71
|
toEmail: string;
|
|
69
72
|
/** Mutually exclusive with {@link InitiateEmailTransferInput.toEmail}; not allowed on the email path. */
|
|
70
73
|
toWallet?: never;
|
|
@@ -76,11 +79,11 @@ export interface InitiateEmailTransferInput {
|
|
|
76
79
|
* Opt in (v1.91) to retaining a `developer` membership in the recipient's org
|
|
77
80
|
* after the transfer completes. Only `role: "developer"` is accepted, and the
|
|
78
81
|
* subject is always the initiating owner (you can only retain yourself). The
|
|
79
|
-
* recipient must explicitly accept it at
|
|
80
|
-
* {@link
|
|
82
|
+
* recipient must explicitly accept it at accept time (see
|
|
83
|
+
* {@link AcceptTransferOptions.acceptRetainedMember}); omitting this is a
|
|
81
84
|
* full severance, the default.
|
|
82
85
|
*/
|
|
83
|
-
|
|
86
|
+
retainMember?: {
|
|
84
87
|
role: "developer";
|
|
85
88
|
} | null;
|
|
86
89
|
/** Billing policy is wallet-path only; not allowed on the email path. */
|
|
@@ -108,7 +111,7 @@ export interface InitiateOrgTransferInput {
|
|
|
108
111
|
/** KySigned record id is wallet-path only; not allowed on the org path. */
|
|
109
112
|
kysignedRecordId?: never;
|
|
110
113
|
/** Retention is an email-only opt-in; not allowed on the org path. */
|
|
111
|
-
|
|
114
|
+
retainMember?: never;
|
|
112
115
|
}
|
|
113
116
|
/** Inputs to `r.admin.transfers.initiate(...)` — wallet XOR email XOR org. */
|
|
114
117
|
export type InitiateTransferInput = InitiateWalletTransferInput | InitiateEmailTransferInput | InitiateOrgTransferInput;
|
|
@@ -127,7 +130,7 @@ export interface InitiateTransferResult {
|
|
|
127
130
|
lease_refundable: false;
|
|
128
131
|
terms_sha256: string;
|
|
129
132
|
}
|
|
130
|
-
/** Result of an email-addressed `initiate`. The recipient completes via `
|
|
133
|
+
/** Result of an email-addressed `initiate`. The recipient completes via `accept`. */
|
|
131
134
|
export interface InitiateEmailTransferResult {
|
|
132
135
|
status: "ok";
|
|
133
136
|
transfer_id: string;
|
|
@@ -157,7 +160,8 @@ export interface InitiateOrgTransferResult {
|
|
|
157
160
|
github_repo_note?: string;
|
|
158
161
|
[key: string]: unknown;
|
|
159
162
|
}
|
|
160
|
-
|
|
163
|
+
/** Result of accepting a WALLET-addressed transfer. */
|
|
164
|
+
export interface AcceptWalletTransferResult {
|
|
161
165
|
project_id: string;
|
|
162
166
|
from_wallet: string;
|
|
163
167
|
to_wallet: string;
|
|
@@ -174,6 +178,32 @@ export interface AcceptTransferResult {
|
|
|
174
178
|
/** Verbatim reminder that GitHub repo ownership is NOT part of the transfer. */
|
|
175
179
|
github_repo_note: string;
|
|
176
180
|
}
|
|
181
|
+
/**
|
|
182
|
+
* Result of accepting an EMAIL-addressed transfer. Symmetric with the wallet
|
|
183
|
+
* result: the completion returns the new owner's project keys
|
|
184
|
+
* (`project-transfer-accept-credentials`), and `accept` persists them to the
|
|
185
|
+
* keystore so the new owner can operate the project immediately.
|
|
186
|
+
*/
|
|
187
|
+
export interface AcceptEmailTransferResult {
|
|
188
|
+
status: "accepted";
|
|
189
|
+
project_id: string;
|
|
190
|
+
to_organization_id: string;
|
|
191
|
+
created_new_org: boolean;
|
|
192
|
+
/**
|
|
193
|
+
* The sender's principal id retained as a `developer` of the new org, or
|
|
194
|
+
* `null` when no membership was retained (declined, not offered, or no-op).
|
|
195
|
+
*/
|
|
196
|
+
retained_member_principal_id: string | null;
|
|
197
|
+
/** Present when the gateway reports the credential rotation it performed. */
|
|
198
|
+
credentials_revoked?: boolean;
|
|
199
|
+
credentials_issued?: boolean;
|
|
200
|
+
/** New owner's project anon key (stateless `project_id`-derived JWT). `accept` persists it. */
|
|
201
|
+
anon_key: string;
|
|
202
|
+
/** New owner's project service key (stateless `project_id`-derived JWT). Full project access; persisted on accept. */
|
|
203
|
+
service_key: string;
|
|
204
|
+
}
|
|
205
|
+
/** Result of {@link Transfers.accept} — the row's recipient kind decides which shape comes back. */
|
|
206
|
+
export type AcceptTransferResult = AcceptWalletTransferResult | AcceptEmailTransferResult;
|
|
177
207
|
export interface CancelTransferResult {
|
|
178
208
|
transfer_id: string;
|
|
179
209
|
status: "cancelled";
|
|
@@ -273,12 +303,12 @@ export interface BillingImplications {
|
|
|
273
303
|
custom_domains_count: number;
|
|
274
304
|
}
|
|
275
305
|
/**
|
|
276
|
-
* The sender-retained-membership offer block on an email transfer preview
|
|
277
|
-
*
|
|
278
|
-
*
|
|
279
|
-
* (`"
|
|
306
|
+
* The sender-retained-membership offer block on an email transfer preview,
|
|
307
|
+
* or `null` when the sender requested no retention. `accept_field` names the
|
|
308
|
+
* accept body field the recipient sets to accept
|
|
309
|
+
* (`"accept_retained_member"`).
|
|
280
310
|
*/
|
|
281
|
-
export interface
|
|
311
|
+
export interface RetainMemberPreview {
|
|
282
312
|
principal_id: string;
|
|
283
313
|
role: "developer";
|
|
284
314
|
sender_label: string;
|
|
@@ -289,7 +319,7 @@ export interface RetainCollaboratorPreview {
|
|
|
289
319
|
}
|
|
290
320
|
/**
|
|
291
321
|
* Kind-agnostic preview document. Wallet-identity fields are `null` on email
|
|
292
|
-
* and org rows; `to_email` and `
|
|
322
|
+
* and org rows; `to_email` and `retain_member` are populated on email
|
|
293
323
|
* rows, while org rows carry `to_org_id` / `to_organization_id` when returned.
|
|
294
324
|
*/
|
|
295
325
|
export interface ProjectTransferPreview {
|
|
@@ -324,8 +354,8 @@ export interface ProjectTransferPreview {
|
|
|
324
354
|
signers: SignerPreview[];
|
|
325
355
|
github_repo_note: string;
|
|
326
356
|
billing_implications: BillingImplications;
|
|
327
|
-
/**
|
|
328
|
-
|
|
357
|
+
/** Sender-retained-membership offer (email rows), or `null` when none was requested. */
|
|
358
|
+
retain_member?: RetainMemberPreview | null;
|
|
329
359
|
initiated_by?: OperationActorSnapshot | null;
|
|
330
360
|
source_organization?: {
|
|
331
361
|
org_id: string;
|
|
@@ -335,38 +365,16 @@ export interface ProjectTransferPreview {
|
|
|
335
365
|
} | null;
|
|
336
366
|
recipient_principal?: PrincipalRepresentation | null;
|
|
337
367
|
}
|
|
338
|
-
/**
|
|
339
|
-
export interface
|
|
340
|
-
/** Org
|
|
341
|
-
|
|
342
|
-
/**
|
|
343
|
-
* Accept the sender's v1.91 retained-`developer`-membership offer (see the
|
|
344
|
-
* preview's `retain_collaborator` block). Only an explicit `true`
|
|
345
|
-
* materializes the membership in the new org; omitting it (the default) is a
|
|
346
|
-
* full severance.
|
|
347
|
-
*/
|
|
348
|
-
acceptRetainedCollaborator?: boolean;
|
|
349
|
-
}
|
|
350
|
-
/**
|
|
351
|
-
* Result of {@link Transfers.claim}. Symmetric with wallet {@link Transfers.accept}:
|
|
352
|
-
* the email completion returns the new owner's project keys
|
|
353
|
-
* (`project-transfer-claim-credentials`), and `claim` persists them to the
|
|
354
|
-
* keystore so the claimant can operate the project immediately.
|
|
355
|
-
*/
|
|
356
|
-
export interface ClaimTransferResult {
|
|
357
|
-
status: "accepted";
|
|
358
|
-
project_id: string;
|
|
359
|
-
to_organization_id: string;
|
|
360
|
-
created_new_org: boolean;
|
|
368
|
+
/** Options to {@link Transfers.accept}; both fields apply to EMAIL-addressed rows only. */
|
|
369
|
+
export interface AcceptTransferOptions {
|
|
370
|
+
/** Org to receive the project. Omit to create a brand-new wallet-less org. */
|
|
371
|
+
orgId?: string;
|
|
361
372
|
/**
|
|
362
|
-
*
|
|
363
|
-
*
|
|
373
|
+
* Accept the sender's retained-`developer`-membership offer (see the
|
|
374
|
+
* preview's `retain_member` block). Only an explicit `true` materializes the
|
|
375
|
+
* membership in the new org; omitting it (the default) is a full severance.
|
|
364
376
|
*/
|
|
365
|
-
|
|
366
|
-
/** New owner's project anon key (stateless `project_id`-derived JWT). `claim` persists it. */
|
|
367
|
-
anon_key: string;
|
|
368
|
-
/** New owner's project service key (stateless `project_id`-derived JWT). Full project access; persisted on claim. */
|
|
369
|
-
service_key: string;
|
|
377
|
+
acceptRetainedMember?: boolean;
|
|
370
378
|
}
|
|
371
379
|
export declare class Transfers {
|
|
372
380
|
private readonly client;
|
|
@@ -376,7 +384,7 @@ export declare class Transfers {
|
|
|
376
384
|
* (`toEmail`), OR an owned org (`toOrgId`), exactly one. Caller must
|
|
377
385
|
* currently own/admin `projectId` (gateway re-reads owner from DB, not cache).
|
|
378
386
|
* Wallet/email recipients create a `pending` row with a 72h expiry and freeze
|
|
379
|
-
* owner-side mutations until accepted/
|
|
387
|
+
* owner-side mutations until accepted/cancelled/expired. The first
|
|
380
388
|
* org-recipient gateway release is same-actor only and completes immediately.
|
|
381
389
|
*/
|
|
382
390
|
initiate(input: InitiateWalletTransferInput): Promise<InitiateTransferResult>;
|
|
@@ -388,26 +396,21 @@ export declare class Transfers {
|
|
|
388
396
|
* principal, or offering-org member); other callers receive 403. Preview
|
|
389
397
|
* lists secret NAMES (not values), custom domains, functions, CI bindings
|
|
390
398
|
* that will be revoked at completion, the billing implications, and — on
|
|
391
|
-
* email rows — the `
|
|
399
|
+
* email rows — the `retain_member` offer.
|
|
392
400
|
*/
|
|
393
401
|
preview(transferId: string): Promise<ProjectTransferPreview>;
|
|
394
402
|
/**
|
|
395
|
-
* Accept an incoming
|
|
396
|
-
*
|
|
397
|
-
*
|
|
398
|
-
*
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
*
|
|
403
|
-
*
|
|
404
|
-
* of {@link Transfers.accept}) and returns the new owner's project keys, which
|
|
405
|
-
* `claim` persists to the keystore — symmetric with `accept` — so the claimant can operate the
|
|
406
|
-
* project immediately. Note the claim auth model is principal-based (a
|
|
407
|
-
* control-plane session or a verified-email SIWX match), so — unlike `accept`
|
|
408
|
-
* — a wallet is not assumed to be present.
|
|
403
|
+
* Accept an incoming transfer — the ONE completion, whatever the row's
|
|
404
|
+
* address. A wallet-addressed row is accepted by the `to_wallet`'s SIWX
|
|
405
|
+
* signature; an email-addressed row by a principal (sign-in session or
|
|
406
|
+
* SIWX) whose verified email matches, into an org it owns (`orgId`) or,
|
|
407
|
+
* omitted, a newly created wallet-less org. Both paths run the same atomic
|
|
408
|
+
* transaction: ownership flip, grant/CI revoke, notification enqueue, the
|
|
409
|
+
* persistent `secrets_rotation_advised` advisory, and an audit row. Both
|
|
410
|
+
* return the new owner's project keys, which `accept` persists to the
|
|
411
|
+
* keystore so the new owner can operate the project immediately.
|
|
409
412
|
*/
|
|
410
|
-
|
|
413
|
+
accept(transferId: string, opts?: AcceptTransferOptions): Promise<AcceptTransferResult>;
|
|
411
414
|
/**
|
|
412
415
|
* Cancel a pending transfer of any kind. The caller must be authorized for
|
|
413
416
|
* the row's kind (a wallet signer, or an owner/admin of the offering org /
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"transfers.d.ts","sourceRoot":"","sources":["../../src/namespaces/transfers.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"transfers.d.ts","sourceRoot":"","sources":["../../src/namespaces/transfers.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6BG;AAEH,OAAO,KAAK,EAAE,sBAAsB,EAAE,uBAAuB,EAAE,MAAM,2BAA2B,CAAC;AAEjG,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,cAAc,CAAC;AAK3C,iIAAiI;AACjI,MAAM,MAAM,qBAAqB,GAAG,SAAS,CAAC;AAE9C,MAAM,MAAM,cAAc,GAAG,SAAS,GAAG,UAAU,GAAG,WAAW,GAAG,SAAS,CAAC;AAE9E,MAAM,MAAM,mBAAmB,GAAG,aAAa,GAAG,WAAW,GAAG,QAAQ,CAAC;AAEzE,8DAA8D;AAC9D,MAAM,MAAM,aAAa,GAAG,QAAQ,GAAG,OAAO,GAAG,KAAK,CAAC;AAEvD,mGAAmG;AACnG,MAAM,WAAW,qBAAqB;IACpC,2EAA2E;IAC3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O,CAAC,oBAAoB,CAAC;IAc7F,uFAAuF;IACjF,YAAY,CAAC,IAAI,GAAE,oBAAyB,GAAG,OAAO,CAAC,mBAAmB,CAAC;IAQjF,yFAAyF;IACnF,YAAY,CAAC,IAAI,GAAE,oBAAyB,GAAG,OAAO,CAAC,mBAAmB,CAAC;CAOlF"}
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
*
|
|
5
5
|
* Exposed as `r.admin.transfers.*`. Project transfer is ONE capability,
|
|
6
6
|
* body-discriminated by recipient kind: a wallet recipient (`toWallet`, SIWX
|
|
7
|
-
* bilateral signing), an email recipient (`toEmail`, the recipient
|
|
7
|
+
* bilateral signing), an email recipient (`toEmail`, the recipient accepts into
|
|
8
8
|
* an org), or an owned org recipient (`toOrgId`, same-actor org move). All ride
|
|
9
9
|
* the same `/transfers` surface — there is no separate `/handoffs` noun (the
|
|
10
10
|
* gateway removed it in `unify-project-transfer-surface`).
|
|
@@ -14,16 +14,19 @@
|
|
|
14
14
|
* GET /agent/v1/transfers/incoming — inbox (pending kinds, unioned)
|
|
15
15
|
* GET /agent/v1/transfers/outgoing — outbox (pending kinds, unioned)
|
|
16
16
|
* GET /agent/v1/transfers/:transfer_id — preview (kind-agnostic)
|
|
17
|
-
* POST /agent/v1/transfers/:transfer_id/accept —
|
|
18
|
-
*
|
|
17
|
+
* POST /agent/v1/transfers/:transfer_id/accept — the ONE completion; the row's recipient kind
|
|
18
|
+
* picks the credential (wallet: to_wallet's SIWX;
|
|
19
|
+
* email: a principal whose verified email matches,
|
|
20
|
+
* body { org_id?, accept_retained_member? })
|
|
19
21
|
* POST /agent/v1/transfers/:transfer_id/cancel — cancel (kind-agnostic)
|
|
20
22
|
*
|
|
21
23
|
* Owner-side mutations against a project with a pending transfer return
|
|
22
24
|
* 409 `PROJECT_HAS_PENDING_TRANSFER`. The SDK kernel surfaces that as
|
|
23
|
-
* {@link TransferFreezeError} so agents can guide the user to cancel.
|
|
24
|
-
* the wrong
|
|
25
|
-
* 409 `WRONG_COMPLETION_FOR_TRANSFER_KIND`; the
|
|
26
|
-
*
|
|
25
|
+
* {@link TransferFreezeError} so agents can guide the user to cancel. Accepting
|
|
26
|
+
* with the wrong credential for a row's kind (e.g. a wallet signature on an
|
|
27
|
+
* email-addressed row) returns 409 `WRONG_COMPLETION_FOR_TRANSFER_KIND`; the
|
|
28
|
+
* thrown error exposes an `accept_transfer` next action naming the credential
|
|
29
|
+
* the row needs, on the SAME `transfer_id`.
|
|
27
30
|
*/
|
|
28
31
|
import { LocalError } from "../errors.js";
|
|
29
32
|
// ─── Class ───────────────────────────────────────────────────────────────────
|
|
@@ -47,7 +50,7 @@ export class Transfers {
|
|
|
47
50
|
if (hasOrg) {
|
|
48
51
|
rejectDefinedField(input, "billingPolicy", "org");
|
|
49
52
|
rejectDefinedField(input, "kysignedRecordId", "org");
|
|
50
|
-
rejectDefinedField(input, "
|
|
53
|
+
rejectDefinedField(input, "retainMember", "org");
|
|
51
54
|
const body = { to_org_id: toOrgId };
|
|
52
55
|
if (input.message !== undefined)
|
|
53
56
|
body.message = input.message;
|
|
@@ -65,9 +68,9 @@ export class Transfers {
|
|
|
65
68
|
const body = { to_email: toEmail };
|
|
66
69
|
if (input.message !== undefined)
|
|
67
70
|
body.message = input.message;
|
|
68
|
-
const retain = input.
|
|
71
|
+
const retain = input.retainMember;
|
|
69
72
|
if (retain !== undefined)
|
|
70
|
-
body.
|
|
73
|
+
body.retain_member = retain;
|
|
71
74
|
return this.client.request(path, {
|
|
72
75
|
method: "POST",
|
|
73
76
|
body,
|
|
@@ -75,7 +78,7 @@ export class Transfers {
|
|
|
75
78
|
});
|
|
76
79
|
}
|
|
77
80
|
const w = input;
|
|
78
|
-
rejectDefinedField(w, "
|
|
81
|
+
rejectDefinedField(w, "retainMember", "wallet");
|
|
79
82
|
const body = { to_wallet: toWallet };
|
|
80
83
|
if (w.billingPolicy !== undefined)
|
|
81
84
|
body.billing_policy = w.billingPolicy;
|
|
@@ -95,46 +98,36 @@ export class Transfers {
|
|
|
95
98
|
* principal, or offering-org member); other callers receive 403. Preview
|
|
96
99
|
* lists secret NAMES (not values), custom domains, functions, CI bindings
|
|
97
100
|
* that will be revoked at completion, the billing implications, and — on
|
|
98
|
-
* email rows — the `
|
|
101
|
+
* email rows — the `retain_member` offer.
|
|
99
102
|
*/
|
|
100
103
|
async preview(transferId) {
|
|
101
104
|
return this.client.request(`/agent/v1/transfers/${encodeURIComponent(transferId)}`, { context: "previewing project transfer" });
|
|
102
105
|
}
|
|
103
106
|
/**
|
|
104
|
-
* Accept an incoming
|
|
105
|
-
*
|
|
106
|
-
*
|
|
107
|
-
*
|
|
107
|
+
* Accept an incoming transfer — the ONE completion, whatever the row's
|
|
108
|
+
* address. A wallet-addressed row is accepted by the `to_wallet`'s SIWX
|
|
109
|
+
* signature; an email-addressed row by a principal (sign-in session or
|
|
110
|
+
* SIWX) whose verified email matches, into an org it owns (`orgId`) or,
|
|
111
|
+
* omitted, a newly created wallet-less org. Both paths run the same atomic
|
|
112
|
+
* transaction: ownership flip, grant/CI revoke, notification enqueue, the
|
|
113
|
+
* persistent `secrets_rotation_advised` advisory, and an audit row. Both
|
|
114
|
+
* return the new owner's project keys, which `accept` persists to the
|
|
115
|
+
* keystore so the new owner can operate the project immediately.
|
|
108
116
|
*/
|
|
109
|
-
async accept(transferId) {
|
|
117
|
+
async accept(transferId, opts = {}) {
|
|
118
|
+
const body = {};
|
|
119
|
+
if (opts.orgId !== undefined)
|
|
120
|
+
body.org_id = opts.orgId;
|
|
121
|
+
if (opts.acceptRetainedMember !== undefined)
|
|
122
|
+
body.accept_retained_member = opts.acceptRetainedMember;
|
|
110
123
|
const result = await this.client.request(`/agent/v1/transfers/${encodeURIComponent(transferId)}/accept`, {
|
|
111
124
|
method: "POST",
|
|
112
|
-
body
|
|
125
|
+
body,
|
|
113
126
|
context: "accepting project transfer",
|
|
114
127
|
});
|
|
115
128
|
await persistProjectKeys(this.client, result);
|
|
116
129
|
return result;
|
|
117
130
|
}
|
|
118
|
-
/**
|
|
119
|
-
* Claim an incoming EMAIL transfer into an org. Omit `organizationId` to claim
|
|
120
|
-
* into a brand-new org. The claim atomically flips ownership (the email analog
|
|
121
|
-
* of {@link Transfers.accept}) and returns the new owner's project keys, which
|
|
122
|
-
* `claim` persists to the keystore — symmetric with `accept` — so the claimant can operate the
|
|
123
|
-
* project immediately. Note the claim auth model is principal-based (a
|
|
124
|
-
* control-plane session or a verified-email SIWX match), so — unlike `accept`
|
|
125
|
-
* — a wallet is not assumed to be present.
|
|
126
|
-
*/
|
|
127
|
-
async claim(transferId, opts = {}) {
|
|
128
|
-
const body = {};
|
|
129
|
-
if (opts.organizationId !== undefined)
|
|
130
|
-
body.org_id = opts.organizationId;
|
|
131
|
-
if (opts.acceptRetainedCollaborator !== undefined) {
|
|
132
|
-
body.accept_retained_collaborator = opts.acceptRetainedCollaborator;
|
|
133
|
-
}
|
|
134
|
-
const result = await this.client.request(`/agent/v1/transfers/${encodeURIComponent(transferId)}/claim`, { method: "POST", body, context: "claiming project transfer" });
|
|
135
|
-
await persistProjectKeys(this.client, result);
|
|
136
|
-
return result;
|
|
137
|
-
}
|
|
138
131
|
/**
|
|
139
132
|
* Cancel a pending transfer of any kind. The caller must be authorized for
|
|
140
133
|
* the row's kind (a wallet signer, or an owner/admin of the offering org /
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"transfers.js","sourceRoot":"","sources":["../../src/namespaces/transfers.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"transfers.js","sourceRoot":"","sources":["../../src/namespaces/transfers.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6BG;AAKH,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAwX1C,gFAAgF;AAEhF,MAAM,OAAO,SAAS;IACS;IAA7B,YAA6B,MAAc;QAAd,WAAM,GAAN,MAAM,CAAQ;IAAG,CAAC;IAa/C,KAAK,CAAC,QA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
2
|
-
* `vouchers` namespace — redeem a promo code
|
|
2
|
+
* `vouchers` namespace — redeem a promo code into the organization's allowance.
|
|
3
3
|
*
|
|
4
|
-
* A promo code
|
|
5
|
-
*
|
|
6
|
-
* it with no on-chain payment.
|
|
4
|
+
* A promo code adds to your organization's allowance, which spends like any
|
|
5
|
+
* other allowance: a tier purchase settles from it with no on-chain payment.
|
|
7
6
|
*
|
|
8
7
|
* Two properties make this safe to call from anywhere in an agent's lifecycle:
|
|
9
8
|
*
|
|
@@ -11,7 +10,7 @@
|
|
|
11
10
|
* call a brand-new wallet makes (the organization is provisioned on demand),
|
|
12
11
|
* or long after `run402 init`. There is no init-before-redeem requirement.
|
|
13
12
|
* - **Retrying is safe.** A repeat by the same organization returns the ORIGINAL
|
|
14
|
-
* result with `already_redeemed: true` and never
|
|
13
|
+
* result with `already_redeemed: true` and never adds twice, so a call that
|
|
15
14
|
* times out client-side can simply be re-issued.
|
|
16
15
|
*
|
|
17
16
|
* This namespace is deliberately thin and semantically blind: it forwards an
|
|
@@ -22,7 +21,7 @@
|
|
|
22
21
|
import type { Client } from "../kernel.js";
|
|
23
22
|
/**
|
|
24
23
|
* A follow-up the gateway suggests after a redemption — most often buying the
|
|
25
|
-
* tier the new
|
|
24
|
+
* tier the new allowance now covers.
|
|
26
25
|
*/
|
|
27
26
|
export interface VoucherNextAction {
|
|
28
27
|
type: string;
|
|
@@ -35,20 +34,20 @@ export interface VoucherNextAction {
|
|
|
35
34
|
}
|
|
36
35
|
export interface RedeemVoucherResult {
|
|
37
36
|
voucher_id: string;
|
|
38
|
-
/**
|
|
37
|
+
/** Amount this voucher added to the allowance. */
|
|
39
38
|
amount_usd_micros: number;
|
|
40
|
-
/** The organization's
|
|
39
|
+
/** The organization's allowance AFTER the redemption. */
|
|
41
40
|
balance_usd_micros: number;
|
|
42
41
|
organization_id: string;
|
|
43
42
|
redeemed_at: string;
|
|
44
43
|
/**
|
|
45
44
|
* True when THIS organization had already redeemed this code. The original
|
|
46
|
-
* result is returned unchanged and
|
|
45
|
+
* result is returned unchanged and nothing was added twice — a replay is
|
|
47
46
|
* reported honestly rather than dressed up as a fresh redemption.
|
|
48
47
|
*/
|
|
49
48
|
already_redeemed: boolean;
|
|
50
49
|
/**
|
|
51
|
-
* The lifetime promo-
|
|
50
|
+
* The lifetime promo-allowance ceiling that applied: what this organization may
|
|
52
51
|
* ever redeem from THIS voucher's issuer, in total. A code from a different
|
|
53
52
|
* issuer (a launch voucher handed out by the platform) has its own ceiling.
|
|
54
53
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"vouchers.d.ts","sourceRoot":"","sources":["../../src/namespaces/vouchers.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"vouchers.d.ts","sourceRoot":"","sources":["../../src/namespaces/vouchers.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAEH,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,cAAc,CAAC;AAG3C;;;GAGG;AACH,MAAM,WAAW,iBAAiB;IAChC,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,4DAA4D;IAC5D,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC;CACxB;AAED,MAAM,WAAW,mBAAmB;IAClC,UAAU,EAAE,MAAM,CAAC;IACnB,kDAAkD;IAClD,iBAAiB,EAAE,MAAM,CAAC;IAC1B,yDAAyD;IACzD,kBAAkB,EAAE,MAAM,CAAC;IAC3B,eAAe,EAAE,MAAM,CAAC;IACxB,WAAW,EAAE,MAAM,CAAC;IACpB;;;;OAIG;IACH,gBAAgB,EAAE,OAAO,CAAC;IAC1B;;;;OAIG;IACH,iCAAiC,EAAE,MAAM,CAAC;IAC1C,YAAY,EAAE,iBAAiB,EAAE,CAAC;CACnC;AAED,qBAAa,QAAQ;IAIP,OAAO,CAAC,QAAQ,CAAC,MAAM;IAHnC,+BAA+B;IAC/B,QAAQ,CAAC,UAAU,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,OAAO,CAAC,mBAAmB,CAAC,CAAC;gBAEvC,MAAM,EAAE,MAAM;IAI3C;;;;;;;;;;;;;;OAcG;IACG,MAAM,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,mBAAmB,CAAC;CAQzD"}
|
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* `vouchers` namespace — redeem a promo code
|
|
2
|
+
* `vouchers` namespace — redeem a promo code into the organization's allowance.
|
|
3
3
|
*
|
|
4
|
-
* A promo code
|
|
5
|
-
*
|
|
6
|
-
* it with no on-chain payment.
|
|
4
|
+
* A promo code adds to your organization's allowance, which spends like any
|
|
5
|
+
* other allowance: a tier purchase settles from it with no on-chain payment.
|
|
7
6
|
*
|
|
8
7
|
* Two properties make this safe to call from anywhere in an agent's lifecycle:
|
|
9
8
|
*
|
|
@@ -11,7 +10,7 @@
|
|
|
11
10
|
* call a brand-new wallet makes (the organization is provisioned on demand),
|
|
12
11
|
* or long after `run402 init`. There is no init-before-redeem requirement.
|
|
13
12
|
* - **Retrying is safe.** A repeat by the same organization returns the ORIGINAL
|
|
14
|
-
* result with `already_redeemed: true` and never
|
|
13
|
+
* result with `already_redeemed: true` and never adds twice, so a call that
|
|
15
14
|
* times out client-side can simply be re-issued.
|
|
16
15
|
*
|
|
17
16
|
* This namespace is deliberately thin and semantically blind: it forwards an
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"vouchers.js","sourceRoot":"","sources":["../../src/namespaces/vouchers.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"vouchers.js","sourceRoot":"","sources":["../../src/namespaces/vouchers.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAGH,OAAO,EAAE,oBAAoB,EAAE,MAAM,kBAAkB,CAAC;AAuCxD,MAAM,OAAO,QAAQ;IAIU;IAH7B,+BAA+B;IACtB,UAAU,CAAiD;IAEpE,YAA6B,MAAc;QAAd,WAAM,GAAN,MAAM,CAAQ;QACzC,IAAI,CAAC,UAAU,GAAG,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IAC3C,CAAC;IAED;;;;;;;;;;;;;;OAcG;IACH,KAAK,CAAC,MAAM,CAAC,IAAY;QACvB,oBAAoB,CAAC,IAAI,EAAE,MAAM,EAAE,wBAAwB,CAAC,CAAC;QAC7D,OAAO,IAAI,CAAC,MAAM,CAAC,OAAO,CAAsB,0BAA0B,EAAE;YAC1E,MAAM,EAAE,MAAM;YACd,IAAI,EAAE,EAAE,IAAI,EAAE;YACd,OAAO,EAAE,wBAAwB;SAClC,CAAC,CAAC;IACL,CAAC;CACF"}
|