@extrovert.dev/sdk 0.1.0-pre.16 → 0.1.0-pre.17

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.cts CHANGED
@@ -4762,7 +4762,19 @@ interface SignUpRequest {
4762
4762
  * (verification-only, with no inbox read or send permission) that expires with the emailed code. Successful verification revokes
4763
4763
  * it and returns a replacement full-scope key. The OTP itself is never returned.
4764
4764
  */
4765
+ interface InboxActivation {
4766
+ agent_id: string;
4767
+ address: string;
4768
+ human_email: string;
4769
+ created_ms: number;
4770
+ expires_ms: number;
4771
+ revision: number;
4772
+ state: "pending" | "proven" | "activated" | "expired";
4773
+ }
4765
4774
  interface SignUpResponse {
4775
+ activation_method?: "incoming_email";
4776
+ human_email?: string;
4777
+ activation_expires_at?: string;
4766
4778
  customer_id: string;
4767
4779
  agent_id: string;
4768
4780
  /** Limited-scope bootstrap key, shown once and bounded by `otp_expires_at`. */
@@ -4773,14 +4785,14 @@ interface SignUpResponse {
4773
4785
  address: string;
4774
4786
  verified: boolean;
4775
4787
  /** Where the verification code was sent. */
4776
- otp_sent_to: string;
4777
- otp_expires_at: IsoTimestamp;
4788
+ otp_sent_to?: string;
4789
+ otp_expires_at?: IsoTimestamp;
4778
4790
  message: string;
4779
4791
  }
4780
4792
  /** Request body for `POST /v1/agent/verify`. */
4781
4793
  interface VerifyRequest {
4782
4794
  /** The one-time code delivered to the signup human email. */
4783
- otp: string;
4795
+ otp?: string;
4784
4796
  }
4785
4797
  /** One copy-ready MCP operation in the post-verification mailbox handoff. */
4786
4798
  interface MailboxQuickstartCall {
@@ -4997,6 +5009,8 @@ interface Transport {
4997
5009
  administrativeRequest(request: AdministrativeRequest): Promise<unknown>;
4998
5010
  enroll(req: EnrollRequest, signal?: AbortSignal): Promise<EnrollResponse>;
4999
5011
  signUp(req: SignUpRequest, signal?: AbortSignal): Promise<SignUpResponse>;
5012
+ activationStatus(signal?: AbortSignal): Promise<InboxActivation>;
5013
+ correctActivationEmail(human_email: string, revision: number, signal?: AbortSignal): Promise<InboxActivation>;
5000
5014
  verify(req: VerifyRequest, signal?: AbortSignal): Promise<VerifyResponse>;
5001
5015
  whoami(signal?: AbortSignal): Promise<WhoAmI>;
5002
5016
  createInbox(req: CreateInboxRequest, idempotencyKey?: string, signal?: AbortSignal): Promise<Inbox>;
@@ -5104,6 +5118,12 @@ interface Transport {
5104
5118
  * SDK exposes. One instance per mock client so tests/examples don't bleed into each other.
5105
5119
  */
5106
5120
  declare class MockBackend {
5121
+ incomingActivation: boolean;
5122
+ private pendingActivation?;
5123
+ activationStatus(): InboxActivation;
5124
+ correctActivationEmail(email: string, revision: number): InboxActivation;
5125
+ /** Test-only trusted delivery; never available through a production client. */
5126
+ proveFixtureActivation(sender: string): void;
5107
5127
  private administrativeFixtures;
5108
5128
  configureAdministrativeFixture(credential: string): void;
5109
5129
  administrativeRequest(request: AdministrativeRequest): Promise<unknown>;
@@ -6404,6 +6424,8 @@ declare class ExtrovertClient {
6404
6424
  * Pending verification is also fail-closed with 403 `signup_disabled` while
6405
6425
  * free signup is paused.
6406
6426
  */
6427
+ activationStatus(signal?: AbortSignal): Promise<InboxActivation>;
6428
+ correctActivationEmail(human_email: string, revision: number, signal?: AbortSignal): Promise<InboxActivation>;
6407
6429
  verify(req: VerifyRequest, signal?: AbortSignal): Promise<VerifyResponse>;
6408
6430
  /** Introspect the principal behind the current key (`GET /v1/auth/me`). */
6409
6431
  whoami(signal?: AbortSignal): Promise<WhoAmI>;
@@ -6969,7 +6991,7 @@ declare function signWebhook(secret: string, body: string, timestampSeconds: num
6969
6991
  *
6970
6992
  * ## Provisional, pre-1.0 (0.x)
6971
6993
  *
6972
- * {@link CONTRACT_VERSION} is **`0.1.0-pre.16`** - a deliberately **provisional**, pre-1.0
6994
+ * {@link CONTRACT_VERSION} is **`0.1.0-pre.17`** - a deliberately **provisional**, pre-1.0
6973
6995
  * contract. It is open and documented, but it MAY still evolve before 1.0: there
6974
6996
  * are no external users yet, and the **D20 shared-pool auto-send governor** is a
6975
6997
  * hard prerequisite before onboarding external users. Pin the version; expect
@@ -7026,12 +7048,12 @@ interface DiffJson {
7026
7048
  /**
7027
7049
  * The published version of the Extrovert Review-Loop open contract (D14).
7028
7050
  *
7029
- * **`0.1.0-pre.16` - PROVISIONAL, pre-1.0.** Versioned *with the SDK* (this package's
7051
+ * **`0.1.0-pre.17` - PROVISIONAL, pre-1.0.** Versioned *with the SDK* (this package's
7030
7052
  * `package.json` version) and aligned to the openapi `info.version`. Open and
7031
7053
  * documented, but MAY still evolve before 1.0 (no external users yet; the D20
7032
7054
  * shared-pool governor is required before external users). Pin it.
7033
7055
  */
7034
- declare const CONTRACT_VERSION: "0.1.0-pre.16";
7056
+ declare const CONTRACT_VERSION: "0.1.0-pre.17";
7035
7057
  /** The stability posture of a published contract version. */
7036
7058
  type ContractStability = "provisional" | "stable";
7037
7059
  /**
@@ -7074,7 +7096,18 @@ interface ContractManifest {
7074
7096
  */
7075
7097
  declare const CONTRACT_MANIFEST: ContractManifest;
7076
7098
 
7099
+ /** Advisory usage accompanying mail responses. Native writes enforce the cap. */
7100
+ interface StorageWarning {
7101
+ threshold: 90 | 95 | 99 | 100;
7102
+ used_bytes: number;
7103
+ limit_bytes: number;
7104
+ cleanup_url?: string;
7105
+ billing_url?: string;
7106
+ }
7107
+ /** Read from a custom fetch response without consuming its body. */
7108
+ declare function storageWarningFromHeaders(headers: Headers): StorageWarning | undefined;
7109
+
7077
7110
  /** Explicit offline full-control fixture; ordinary mock agent keys stay scoped. */
7078
7111
  declare const ADMINISTRATIVE_FIXTURE_KEY = "ev_credential_mock_full_account";
7079
7112
 
7080
- export { ADMINISTRATIVE_FIXTURE_KEY, API_VERSION_HEADER, type AccountRiskDial, type AckReviewEventEntry, type AckReviewEventRequest, type AckReviewEventResult, type AddContactListRequest, Administration, type AdministrativeActionID, type AdministrativeActionSummary, type AdministrativeDownload, type AdministrativeInput, type AdministrativeMode, type AdministrativeOperations, type Agent, type AgentStatus, ApiError, type ApiErrorBody, type Attachment, type AttachmentDownload, type AttachmentInput, AuthenticationError, type BatchUpdateMessagesRequest, type BatchUpdateResult, BornStaleError, BreadthRequiredError, CONTRACT_MANIFEST, CONTRACT_VERSION, CURRENT_API_VERSION, Categories, type Category, type CategoryPacingState, type CategoryRiskDial, Commerce, type CommerceBlocker, type CommerceRequest, type CommerceRequestKind, ConflictError, ConnectionError, type ConnectionResourceSelection, type ContactListDirection, type ContactListEntry, type ContactListKind, ContactLists, type ContractManifest, type ContractStability, type CreateInboxRequest, type Cursor, DEFAULT_BASE_URL, type DeleteResult, type DiffHunk, type DiffJson, type Domain, type DomainOffboard, type DomainQuote, type DomainReadiness, type DomainRecord, type DomainScope, type DomainStatusEvent, type DomainStatusEventPage, type DomainWaitResult, Domains, type EffectiveRiskDial, type EmailAddress, type EnrollRequest, type EnrollResponse, type ExtractedCredentials, ExtrovertClient as Extrovert, ExtrovertClient, type ExtrovertClientOptions, ForbiddenScopeError, type ForwardRequest, type GetInboxParams, type GetRuleAuditParams, type GetRulesParams, type GraduationStatus, IdempotencyConflictError, type Inbox, type InboxCredentials, InboxHandle, type InboxInclude, type InboxMetadata, type InboxMetadataPatch, type InboxMetadataValue, type InboxStatus, Inboxes, IntentRequiredError, type IsoTimestamp, type Job, type KeyTier, type LearnReviewRuleRequest, type LearnedReviewRule, type List, type ListCategoriesParams, type ListCommerceRequestsParams, type ListInboxesParams, type ListMessagesParams, ListPage, type ListParams, type ListReviewEventsParams, type ListReviewsParams, type ListSuppressionsParams, type ListThreadsParams, type ListWebhooksParams, MOCK_BASE_URL, type MailFolder, type MailboxQuickstart, type MailboxQuickstartCall, type MarkReadRequest, type Message, type MessageDirection, Messages, MockBackend, NotFoundError, type OnboardDomainRequest, type OnboardingMode, PROBLEM_CODES, type PacingItem, type Page, type PageFetcher, PaymentRequiredError, PermissionError, type PostReviewChatRequest, type Problem, type ProblemCode, type ProblemField, type ProjectInboxListParams, ProjectInboxes, Projects, type ProposeCategoryRequest, type ProposeGraduationRequest, type QueuedForReviewResult, type QuoteDomainRequest, REVIEW_PROBLEM_RETRYABLE, RateLimitError, RecipientSuppressedError, type RegisterWebhookRequest, type ReplyRequest, type RequestDomainPurchaseRequest, type RequestPlanChangeRequest, type RestampReviewRequest, type Review, ReviewConflictError, type ReviewDecisionContext, type ReviewEvent, type ReviewEventCursor, type ReviewEventReason, ReviewEvents, type ReviewEventsResult, type ReviewFeedback, type ReviewFeedbackComment, type ReviewInclude, type ReviewIntent, type ReviewMode, type ReviewPolicy, type ReviewState, type ReviewTurn, type ReviewerAction, type ReviewerDecisionRequest, type ReviewerDecisionResult, Reviews, type RiskDial, type Rule, type RuleAuditEntry, type RuleLayer, type RuleSnapshot, Rules, SDK_VERSION, type SaveRuleRequest, type ScanBacklogStatus, type Scope, type SearchMessagesParams, SendNeedsReconciliationError, type SendOutcome, type SendRequest, type SendResult, type SentCopyStatus, type SentResult, type SignUpRequest, type SignUpResponse, StaleError, type StreamEvent, type StreamOptions, type Submission, type SubmissionRecipientState, type SubmissionTracking, Submissions, type SubmitForReviewResult, type SubmitRevisionRequest, type SuppressionEntry, type SuppressionPrecheck, type SuppressionScope, type SuppressionSource, Suppressions, TerminalError, type Thread, type ThreadDetail, Threads, TimeoutError, type TransportCounts, UnavailableError, type UpdateCategoryRequest, type UpdateInboxRequest, type UpdateWebhookRequest, ValidationError, type VerifyRequest, type VerifyResponse, type VerifyWebhookOptions, type WaitForEmailRequest, type WaitForEmailResult, type WaitForReviewEventParams, type Webhook, type WebhookEvent, type WebhookPayload, Webhooks, type WhoAmI, WrongStateError, extractCredentials, extractLink, extractOtp, isProblemCode, isQueuedForReview, isSentImmediately, listPage, parseKeyTier, parseProblem, parseWebhook, reviewIdOf, sentMessageIdOf, serializeInclude, signWebhook, threadIdOf, tierAllowsOrgWildcard, tierNeedsExplicitBreadth, verifyWebhookSignature };
7113
+ export { ADMINISTRATIVE_FIXTURE_KEY, API_VERSION_HEADER, type AccountRiskDial, type AckReviewEventEntry, type AckReviewEventRequest, type AckReviewEventResult, type AddContactListRequest, Administration, type AdministrativeActionID, type AdministrativeActionSummary, type AdministrativeDownload, type AdministrativeInput, type AdministrativeMode, type AdministrativeOperations, type Agent, type AgentStatus, ApiError, type ApiErrorBody, type Attachment, type AttachmentDownload, type AttachmentInput, AuthenticationError, type BatchUpdateMessagesRequest, type BatchUpdateResult, BornStaleError, BreadthRequiredError, CONTRACT_MANIFEST, CONTRACT_VERSION, CURRENT_API_VERSION, Categories, type Category, type CategoryPacingState, type CategoryRiskDial, Commerce, type CommerceBlocker, type CommerceRequest, type CommerceRequestKind, ConflictError, ConnectionError, type ConnectionResourceSelection, type ContactListDirection, type ContactListEntry, type ContactListKind, ContactLists, type ContractManifest, type ContractStability, type CreateInboxRequest, type Cursor, DEFAULT_BASE_URL, type DeleteResult, type DiffHunk, type DiffJson, type Domain, type DomainOffboard, type DomainQuote, type DomainReadiness, type DomainRecord, type DomainScope, type DomainStatusEvent, type DomainStatusEventPage, type DomainWaitResult, Domains, type EffectiveRiskDial, type EmailAddress, type EnrollRequest, type EnrollResponse, type ExtractedCredentials, ExtrovertClient as Extrovert, ExtrovertClient, type ExtrovertClientOptions, ForbiddenScopeError, type ForwardRequest, type GetInboxParams, type GetRuleAuditParams, type GetRulesParams, type GraduationStatus, IdempotencyConflictError, type Inbox, type InboxActivation, type InboxCredentials, InboxHandle, type InboxInclude, type InboxMetadata, type InboxMetadataPatch, type InboxMetadataValue, type InboxStatus, Inboxes, IntentRequiredError, type IsoTimestamp, type Job, type KeyTier, type LearnReviewRuleRequest, type LearnedReviewRule, type List, type ListCategoriesParams, type ListCommerceRequestsParams, type ListInboxesParams, type ListMessagesParams, ListPage, type ListParams, type ListReviewEventsParams, type ListReviewsParams, type ListSuppressionsParams, type ListThreadsParams, type ListWebhooksParams, MOCK_BASE_URL, type MailFolder, type MailboxQuickstart, type MailboxQuickstartCall, type MarkReadRequest, type Message, type MessageDirection, Messages, MockBackend, NotFoundError, type OnboardDomainRequest, type OnboardingMode, PROBLEM_CODES, type PacingItem, type Page, type PageFetcher, PaymentRequiredError, PermissionError, type PostReviewChatRequest, type Problem, type ProblemCode, type ProblemField, type ProjectInboxListParams, ProjectInboxes, Projects, type ProposeCategoryRequest, type ProposeGraduationRequest, type QueuedForReviewResult, type QuoteDomainRequest, REVIEW_PROBLEM_RETRYABLE, RateLimitError, RecipientSuppressedError, type RegisterWebhookRequest, type ReplyRequest, type RequestDomainPurchaseRequest, type RequestPlanChangeRequest, type RestampReviewRequest, type Review, ReviewConflictError, type ReviewDecisionContext, type ReviewEvent, type ReviewEventCursor, type ReviewEventReason, ReviewEvents, type ReviewEventsResult, type ReviewFeedback, type ReviewFeedbackComment, type ReviewInclude, type ReviewIntent, type ReviewMode, type ReviewPolicy, type ReviewState, type ReviewTurn, type ReviewerAction, type ReviewerDecisionRequest, type ReviewerDecisionResult, Reviews, type RiskDial, type Rule, type RuleAuditEntry, type RuleLayer, type RuleSnapshot, Rules, SDK_VERSION, type SaveRuleRequest, type ScanBacklogStatus, type Scope, type SearchMessagesParams, SendNeedsReconciliationError, type SendOutcome, type SendRequest, type SendResult, type SentCopyStatus, type SentResult, type SignUpRequest, type SignUpResponse, StaleError, type StorageWarning, type StreamEvent, type StreamOptions, type Submission, type SubmissionRecipientState, type SubmissionTracking, Submissions, type SubmitForReviewResult, type SubmitRevisionRequest, type SuppressionEntry, type SuppressionPrecheck, type SuppressionScope, type SuppressionSource, Suppressions, TerminalError, type Thread, type ThreadDetail, Threads, TimeoutError, type TransportCounts, UnavailableError, type UpdateCategoryRequest, type UpdateInboxRequest, type UpdateWebhookRequest, ValidationError, type VerifyRequest, type VerifyResponse, type VerifyWebhookOptions, type WaitForEmailRequest, type WaitForEmailResult, type WaitForReviewEventParams, type Webhook, type WebhookEvent, type WebhookPayload, Webhooks, type WhoAmI, WrongStateError, extractCredentials, extractLink, extractOtp, isProblemCode, isQueuedForReview, isSentImmediately, listPage, parseKeyTier, parseProblem, parseWebhook, reviewIdOf, sentMessageIdOf, serializeInclude, signWebhook, storageWarningFromHeaders, threadIdOf, tierAllowsOrgWildcard, tierNeedsExplicitBreadth, verifyWebhookSignature };
package/dist/index.d.ts CHANGED
@@ -4762,7 +4762,19 @@ interface SignUpRequest {
4762
4762
  * (verification-only, with no inbox read or send permission) that expires with the emailed code. Successful verification revokes
4763
4763
  * it and returns a replacement full-scope key. The OTP itself is never returned.
4764
4764
  */
4765
+ interface InboxActivation {
4766
+ agent_id: string;
4767
+ address: string;
4768
+ human_email: string;
4769
+ created_ms: number;
4770
+ expires_ms: number;
4771
+ revision: number;
4772
+ state: "pending" | "proven" | "activated" | "expired";
4773
+ }
4765
4774
  interface SignUpResponse {
4775
+ activation_method?: "incoming_email";
4776
+ human_email?: string;
4777
+ activation_expires_at?: string;
4766
4778
  customer_id: string;
4767
4779
  agent_id: string;
4768
4780
  /** Limited-scope bootstrap key, shown once and bounded by `otp_expires_at`. */
@@ -4773,14 +4785,14 @@ interface SignUpResponse {
4773
4785
  address: string;
4774
4786
  verified: boolean;
4775
4787
  /** Where the verification code was sent. */
4776
- otp_sent_to: string;
4777
- otp_expires_at: IsoTimestamp;
4788
+ otp_sent_to?: string;
4789
+ otp_expires_at?: IsoTimestamp;
4778
4790
  message: string;
4779
4791
  }
4780
4792
  /** Request body for `POST /v1/agent/verify`. */
4781
4793
  interface VerifyRequest {
4782
4794
  /** The one-time code delivered to the signup human email. */
4783
- otp: string;
4795
+ otp?: string;
4784
4796
  }
4785
4797
  /** One copy-ready MCP operation in the post-verification mailbox handoff. */
4786
4798
  interface MailboxQuickstartCall {
@@ -4997,6 +5009,8 @@ interface Transport {
4997
5009
  administrativeRequest(request: AdministrativeRequest): Promise<unknown>;
4998
5010
  enroll(req: EnrollRequest, signal?: AbortSignal): Promise<EnrollResponse>;
4999
5011
  signUp(req: SignUpRequest, signal?: AbortSignal): Promise<SignUpResponse>;
5012
+ activationStatus(signal?: AbortSignal): Promise<InboxActivation>;
5013
+ correctActivationEmail(human_email: string, revision: number, signal?: AbortSignal): Promise<InboxActivation>;
5000
5014
  verify(req: VerifyRequest, signal?: AbortSignal): Promise<VerifyResponse>;
5001
5015
  whoami(signal?: AbortSignal): Promise<WhoAmI>;
5002
5016
  createInbox(req: CreateInboxRequest, idempotencyKey?: string, signal?: AbortSignal): Promise<Inbox>;
@@ -5104,6 +5118,12 @@ interface Transport {
5104
5118
  * SDK exposes. One instance per mock client so tests/examples don't bleed into each other.
5105
5119
  */
5106
5120
  declare class MockBackend {
5121
+ incomingActivation: boolean;
5122
+ private pendingActivation?;
5123
+ activationStatus(): InboxActivation;
5124
+ correctActivationEmail(email: string, revision: number): InboxActivation;
5125
+ /** Test-only trusted delivery; never available through a production client. */
5126
+ proveFixtureActivation(sender: string): void;
5107
5127
  private administrativeFixtures;
5108
5128
  configureAdministrativeFixture(credential: string): void;
5109
5129
  administrativeRequest(request: AdministrativeRequest): Promise<unknown>;
@@ -6404,6 +6424,8 @@ declare class ExtrovertClient {
6404
6424
  * Pending verification is also fail-closed with 403 `signup_disabled` while
6405
6425
  * free signup is paused.
6406
6426
  */
6427
+ activationStatus(signal?: AbortSignal): Promise<InboxActivation>;
6428
+ correctActivationEmail(human_email: string, revision: number, signal?: AbortSignal): Promise<InboxActivation>;
6407
6429
  verify(req: VerifyRequest, signal?: AbortSignal): Promise<VerifyResponse>;
6408
6430
  /** Introspect the principal behind the current key (`GET /v1/auth/me`). */
6409
6431
  whoami(signal?: AbortSignal): Promise<WhoAmI>;
@@ -6969,7 +6991,7 @@ declare function signWebhook(secret: string, body: string, timestampSeconds: num
6969
6991
  *
6970
6992
  * ## Provisional, pre-1.0 (0.x)
6971
6993
  *
6972
- * {@link CONTRACT_VERSION} is **`0.1.0-pre.16`** - a deliberately **provisional**, pre-1.0
6994
+ * {@link CONTRACT_VERSION} is **`0.1.0-pre.17`** - a deliberately **provisional**, pre-1.0
6973
6995
  * contract. It is open and documented, but it MAY still evolve before 1.0: there
6974
6996
  * are no external users yet, and the **D20 shared-pool auto-send governor** is a
6975
6997
  * hard prerequisite before onboarding external users. Pin the version; expect
@@ -7026,12 +7048,12 @@ interface DiffJson {
7026
7048
  /**
7027
7049
  * The published version of the Extrovert Review-Loop open contract (D14).
7028
7050
  *
7029
- * **`0.1.0-pre.16` - PROVISIONAL, pre-1.0.** Versioned *with the SDK* (this package's
7051
+ * **`0.1.0-pre.17` - PROVISIONAL, pre-1.0.** Versioned *with the SDK* (this package's
7030
7052
  * `package.json` version) and aligned to the openapi `info.version`. Open and
7031
7053
  * documented, but MAY still evolve before 1.0 (no external users yet; the D20
7032
7054
  * shared-pool governor is required before external users). Pin it.
7033
7055
  */
7034
- declare const CONTRACT_VERSION: "0.1.0-pre.16";
7056
+ declare const CONTRACT_VERSION: "0.1.0-pre.17";
7035
7057
  /** The stability posture of a published contract version. */
7036
7058
  type ContractStability = "provisional" | "stable";
7037
7059
  /**
@@ -7074,7 +7096,18 @@ interface ContractManifest {
7074
7096
  */
7075
7097
  declare const CONTRACT_MANIFEST: ContractManifest;
7076
7098
 
7099
+ /** Advisory usage accompanying mail responses. Native writes enforce the cap. */
7100
+ interface StorageWarning {
7101
+ threshold: 90 | 95 | 99 | 100;
7102
+ used_bytes: number;
7103
+ limit_bytes: number;
7104
+ cleanup_url?: string;
7105
+ billing_url?: string;
7106
+ }
7107
+ /** Read from a custom fetch response without consuming its body. */
7108
+ declare function storageWarningFromHeaders(headers: Headers): StorageWarning | undefined;
7109
+
7077
7110
  /** Explicit offline full-control fixture; ordinary mock agent keys stay scoped. */
7078
7111
  declare const ADMINISTRATIVE_FIXTURE_KEY = "ev_credential_mock_full_account";
7079
7112
 
7080
- export { ADMINISTRATIVE_FIXTURE_KEY, API_VERSION_HEADER, type AccountRiskDial, type AckReviewEventEntry, type AckReviewEventRequest, type AckReviewEventResult, type AddContactListRequest, Administration, type AdministrativeActionID, type AdministrativeActionSummary, type AdministrativeDownload, type AdministrativeInput, type AdministrativeMode, type AdministrativeOperations, type Agent, type AgentStatus, ApiError, type ApiErrorBody, type Attachment, type AttachmentDownload, type AttachmentInput, AuthenticationError, type BatchUpdateMessagesRequest, type BatchUpdateResult, BornStaleError, BreadthRequiredError, CONTRACT_MANIFEST, CONTRACT_VERSION, CURRENT_API_VERSION, Categories, type Category, type CategoryPacingState, type CategoryRiskDial, Commerce, type CommerceBlocker, type CommerceRequest, type CommerceRequestKind, ConflictError, ConnectionError, type ConnectionResourceSelection, type ContactListDirection, type ContactListEntry, type ContactListKind, ContactLists, type ContractManifest, type ContractStability, type CreateInboxRequest, type Cursor, DEFAULT_BASE_URL, type DeleteResult, type DiffHunk, type DiffJson, type Domain, type DomainOffboard, type DomainQuote, type DomainReadiness, type DomainRecord, type DomainScope, type DomainStatusEvent, type DomainStatusEventPage, type DomainWaitResult, Domains, type EffectiveRiskDial, type EmailAddress, type EnrollRequest, type EnrollResponse, type ExtractedCredentials, ExtrovertClient as Extrovert, ExtrovertClient, type ExtrovertClientOptions, ForbiddenScopeError, type ForwardRequest, type GetInboxParams, type GetRuleAuditParams, type GetRulesParams, type GraduationStatus, IdempotencyConflictError, type Inbox, type InboxCredentials, InboxHandle, type InboxInclude, type InboxMetadata, type InboxMetadataPatch, type InboxMetadataValue, type InboxStatus, Inboxes, IntentRequiredError, type IsoTimestamp, type Job, type KeyTier, type LearnReviewRuleRequest, type LearnedReviewRule, type List, type ListCategoriesParams, type ListCommerceRequestsParams, type ListInboxesParams, type ListMessagesParams, ListPage, type ListParams, type ListReviewEventsParams, type ListReviewsParams, type ListSuppressionsParams, type ListThreadsParams, type ListWebhooksParams, MOCK_BASE_URL, type MailFolder, type MailboxQuickstart, type MailboxQuickstartCall, type MarkReadRequest, type Message, type MessageDirection, Messages, MockBackend, NotFoundError, type OnboardDomainRequest, type OnboardingMode, PROBLEM_CODES, type PacingItem, type Page, type PageFetcher, PaymentRequiredError, PermissionError, type PostReviewChatRequest, type Problem, type ProblemCode, type ProblemField, type ProjectInboxListParams, ProjectInboxes, Projects, type ProposeCategoryRequest, type ProposeGraduationRequest, type QueuedForReviewResult, type QuoteDomainRequest, REVIEW_PROBLEM_RETRYABLE, RateLimitError, RecipientSuppressedError, type RegisterWebhookRequest, type ReplyRequest, type RequestDomainPurchaseRequest, type RequestPlanChangeRequest, type RestampReviewRequest, type Review, ReviewConflictError, type ReviewDecisionContext, type ReviewEvent, type ReviewEventCursor, type ReviewEventReason, ReviewEvents, type ReviewEventsResult, type ReviewFeedback, type ReviewFeedbackComment, type ReviewInclude, type ReviewIntent, type ReviewMode, type ReviewPolicy, type ReviewState, type ReviewTurn, type ReviewerAction, type ReviewerDecisionRequest, type ReviewerDecisionResult, Reviews, type RiskDial, type Rule, type RuleAuditEntry, type RuleLayer, type RuleSnapshot, Rules, SDK_VERSION, type SaveRuleRequest, type ScanBacklogStatus, type Scope, type SearchMessagesParams, SendNeedsReconciliationError, type SendOutcome, type SendRequest, type SendResult, type SentCopyStatus, type SentResult, type SignUpRequest, type SignUpResponse, StaleError, type StreamEvent, type StreamOptions, type Submission, type SubmissionRecipientState, type SubmissionTracking, Submissions, type SubmitForReviewResult, type SubmitRevisionRequest, type SuppressionEntry, type SuppressionPrecheck, type SuppressionScope, type SuppressionSource, Suppressions, TerminalError, type Thread, type ThreadDetail, Threads, TimeoutError, type TransportCounts, UnavailableError, type UpdateCategoryRequest, type UpdateInboxRequest, type UpdateWebhookRequest, ValidationError, type VerifyRequest, type VerifyResponse, type VerifyWebhookOptions, type WaitForEmailRequest, type WaitForEmailResult, type WaitForReviewEventParams, type Webhook, type WebhookEvent, type WebhookPayload, Webhooks, type WhoAmI, WrongStateError, extractCredentials, extractLink, extractOtp, isProblemCode, isQueuedForReview, isSentImmediately, listPage, parseKeyTier, parseProblem, parseWebhook, reviewIdOf, sentMessageIdOf, serializeInclude, signWebhook, threadIdOf, tierAllowsOrgWildcard, tierNeedsExplicitBreadth, verifyWebhookSignature };
7113
+ export { ADMINISTRATIVE_FIXTURE_KEY, API_VERSION_HEADER, type AccountRiskDial, type AckReviewEventEntry, type AckReviewEventRequest, type AckReviewEventResult, type AddContactListRequest, Administration, type AdministrativeActionID, type AdministrativeActionSummary, type AdministrativeDownload, type AdministrativeInput, type AdministrativeMode, type AdministrativeOperations, type Agent, type AgentStatus, ApiError, type ApiErrorBody, type Attachment, type AttachmentDownload, type AttachmentInput, AuthenticationError, type BatchUpdateMessagesRequest, type BatchUpdateResult, BornStaleError, BreadthRequiredError, CONTRACT_MANIFEST, CONTRACT_VERSION, CURRENT_API_VERSION, Categories, type Category, type CategoryPacingState, type CategoryRiskDial, Commerce, type CommerceBlocker, type CommerceRequest, type CommerceRequestKind, ConflictError, ConnectionError, type ConnectionResourceSelection, type ContactListDirection, type ContactListEntry, type ContactListKind, ContactLists, type ContractManifest, type ContractStability, type CreateInboxRequest, type Cursor, DEFAULT_BASE_URL, type DeleteResult, type DiffHunk, type DiffJson, type Domain, type DomainOffboard, type DomainQuote, type DomainReadiness, type DomainRecord, type DomainScope, type DomainStatusEvent, type DomainStatusEventPage, type DomainWaitResult, Domains, type EffectiveRiskDial, type EmailAddress, type EnrollRequest, type EnrollResponse, type ExtractedCredentials, ExtrovertClient as Extrovert, ExtrovertClient, type ExtrovertClientOptions, ForbiddenScopeError, type ForwardRequest, type GetInboxParams, type GetRuleAuditParams, type GetRulesParams, type GraduationStatus, IdempotencyConflictError, type Inbox, type InboxActivation, type InboxCredentials, InboxHandle, type InboxInclude, type InboxMetadata, type InboxMetadataPatch, type InboxMetadataValue, type InboxStatus, Inboxes, IntentRequiredError, type IsoTimestamp, type Job, type KeyTier, type LearnReviewRuleRequest, type LearnedReviewRule, type List, type ListCategoriesParams, type ListCommerceRequestsParams, type ListInboxesParams, type ListMessagesParams, ListPage, type ListParams, type ListReviewEventsParams, type ListReviewsParams, type ListSuppressionsParams, type ListThreadsParams, type ListWebhooksParams, MOCK_BASE_URL, type MailFolder, type MailboxQuickstart, type MailboxQuickstartCall, type MarkReadRequest, type Message, type MessageDirection, Messages, MockBackend, NotFoundError, type OnboardDomainRequest, type OnboardingMode, PROBLEM_CODES, type PacingItem, type Page, type PageFetcher, PaymentRequiredError, PermissionError, type PostReviewChatRequest, type Problem, type ProblemCode, type ProblemField, type ProjectInboxListParams, ProjectInboxes, Projects, type ProposeCategoryRequest, type ProposeGraduationRequest, type QueuedForReviewResult, type QuoteDomainRequest, REVIEW_PROBLEM_RETRYABLE, RateLimitError, RecipientSuppressedError, type RegisterWebhookRequest, type ReplyRequest, type RequestDomainPurchaseRequest, type RequestPlanChangeRequest, type RestampReviewRequest, type Review, ReviewConflictError, type ReviewDecisionContext, type ReviewEvent, type ReviewEventCursor, type ReviewEventReason, ReviewEvents, type ReviewEventsResult, type ReviewFeedback, type ReviewFeedbackComment, type ReviewInclude, type ReviewIntent, type ReviewMode, type ReviewPolicy, type ReviewState, type ReviewTurn, type ReviewerAction, type ReviewerDecisionRequest, type ReviewerDecisionResult, Reviews, type RiskDial, type Rule, type RuleAuditEntry, type RuleLayer, type RuleSnapshot, Rules, SDK_VERSION, type SaveRuleRequest, type ScanBacklogStatus, type Scope, type SearchMessagesParams, SendNeedsReconciliationError, type SendOutcome, type SendRequest, type SendResult, type SentCopyStatus, type SentResult, type SignUpRequest, type SignUpResponse, StaleError, type StorageWarning, type StreamEvent, type StreamOptions, type Submission, type SubmissionRecipientState, type SubmissionTracking, Submissions, type SubmitForReviewResult, type SubmitRevisionRequest, type SuppressionEntry, type SuppressionPrecheck, type SuppressionScope, type SuppressionSource, Suppressions, TerminalError, type Thread, type ThreadDetail, Threads, TimeoutError, type TransportCounts, UnavailableError, type UpdateCategoryRequest, type UpdateInboxRequest, type UpdateWebhookRequest, ValidationError, type VerifyRequest, type VerifyResponse, type VerifyWebhookOptions, type WaitForEmailRequest, type WaitForEmailResult, type WaitForReviewEventParams, type Webhook, type WebhookEvent, type WebhookPayload, Webhooks, type WhoAmI, WrongStateError, extractCredentials, extractLink, extractOtp, isProblemCode, isQueuedForReview, isSentImmediately, listPage, parseKeyTier, parseProblem, parseWebhook, reviewIdOf, sentMessageIdOf, serializeInclude, signWebhook, storageWarningFromHeaders, threadIdOf, tierAllowsOrgWildcard, tierNeedsExplicitBreadth, verifyWebhookSignature };
package/dist/index.js CHANGED
@@ -1120,11 +1120,31 @@ ${parent.text}`;
1120
1120
  }
1121
1121
  var MockBackend = class {
1122
1122
  constructor() {
1123
+ this.incomingActivation = false;
1123
1124
  this.administrativeFixtures = new AdministrativeFixtures();
1124
1125
  this.state = freshState();
1125
1126
  /** Save / edit a rule (mock) - append-only by supersession (D11). */
1126
1127
  this.learnedRules = /* @__PURE__ */ new Map();
1127
1128
  }
1129
+ activationStatus() {
1130
+ const activation = this.pendingActivation;
1131
+ if (!activation) throw new Error("No incoming-email activation exists");
1132
+ if (activation.expires_ms <= Date.now() && activation.state !== "activated") activation.state = "expired";
1133
+ return { ...activation };
1134
+ }
1135
+ correctActivationEmail(email, revision) {
1136
+ const activation = this.activationStatus();
1137
+ if (activation.revision !== revision || !["pending", "proven"].includes(activation.state)) throw new Error("Activation changed or expired");
1138
+ if (!/^[^@\s]+@[^@\s]+\.[^@\s]+$/.test(email)) throw new Error("Invalid human email");
1139
+ this.pendingActivation = { ...activation, human_email: email, revision: revision + 1, state: "pending" };
1140
+ return this.activationStatus();
1141
+ }
1142
+ /** Test-only trusted delivery; never available through a production client. */
1143
+ proveFixtureActivation(sender) {
1144
+ const activation = this.activationStatus();
1145
+ if (activation.state !== "pending" || sender !== activation.human_email) throw new Error("Activation sender mismatch or expired");
1146
+ this.pendingActivation = { ...activation, state: "proven" };
1147
+ }
1128
1148
  configureAdministrativeFixture(credential) {
1129
1149
  this.administrativeFixtures = new AdministrativeFixtures(credential);
1130
1150
  }
@@ -1170,6 +1190,10 @@ var MockBackend = class {
1170
1190
  const agentId = existing?.agentId ?? rid("agt");
1171
1191
  const address = existing?.address ?? `${validatedSharedLocalPart(req.username ?? randomHandle())}@${FREE_SHARED_DOMAIN}`;
1172
1192
  const otp = "492013";
1193
+ if (this.incomingActivation) {
1194
+ if (existing) throw new Error("Activation already pending; use the existing key");
1195
+ this.pendingActivation = { agent_id: agentId, address, human_email: email, created_ms: Date.now(), expires_ms: Date.now() + 864e5, revision: 1, state: "pending" };
1196
+ }
1173
1197
  this.state.signupByEmail.set(email, { customerId, agentId, address, otp, verified: false });
1174
1198
  return {
1175
1199
  customer_id: customerId,
@@ -1179,16 +1203,24 @@ var MockBackend = class {
1179
1203
  scopes: ["signup:verify"],
1180
1204
  address,
1181
1205
  verified: false,
1182
- otp_sent_to: email,
1183
- otp_expires_at: new Date(Date.now() + 15 * 60 * 1e3).toISOString(),
1184
- message: "A verification code was sent to your email. Call verify with it."
1206
+ ...this.incomingActivation ? {
1207
+ activation_method: "incoming_email",
1208
+ human_email: email,
1209
+ activation_expires_at: new Date(this.pendingActivation.expires_ms).toISOString(),
1210
+ message: `Your agent\u2019s inbox is almost ready. Send an email from ${email} to ${address} to activate it and link it to your human email.`
1211
+ } : {
1212
+ otp_sent_to: email,
1213
+ otp_expires_at: new Date(Date.now() + 15 * 60 * 1e3).toISOString(),
1214
+ message: "A verification code was sent to your email. Call verify with it."
1215
+ }
1185
1216
  };
1186
1217
  }
1187
1218
  /** Confirm a signup OTP and return a full-scope key (mock). */
1188
1219
  verify(req) {
1189
1220
  for (const [, s] of this.state.signupByEmail) {
1190
- if (!s.verified && s.otp === req.otp.trim()) {
1221
+ if (!s.verified && (this.incomingActivation ? this.activationStatus().state === "proven" && this.pendingActivation?.agent_id === s.agentId : s.otp === (req.otp ?? "").trim())) {
1191
1222
  s.verified = true;
1223
+ if (this.incomingActivation && this.pendingActivation) this.pendingActivation.state = "activated";
1192
1224
  return {
1193
1225
  agent_id: s.agentId,
1194
1226
  agent_key: `pk_agent_${s.agentId.slice(4)}_${rid("sk").slice(3)}`,
@@ -3562,6 +3594,12 @@ var HttpTransport = class {
3562
3594
  signUp(req, signal) {
3563
3595
  return this.call({ method: "POST", path: "/v1/agent/sign-up", body: req, signal });
3564
3596
  }
3597
+ activationStatus(signal) {
3598
+ return this.call({ method: "GET", path: "/v1/agent/activation", signal });
3599
+ }
3600
+ correctActivationEmail(human_email, revision, signal) {
3601
+ return this.call({ method: "PATCH", path: "/v1/agent/activation", body: { human_email, revision }, signal });
3602
+ }
3565
3603
  verify(req, signal) {
3566
3604
  return this.call({ method: "POST", path: "/v1/agent/verify", body: req, signal });
3567
3605
  }
@@ -4194,6 +4232,12 @@ var MockTransport = class {
4194
4232
  async signUp(req) {
4195
4233
  return this.backend.signUp(req);
4196
4234
  }
4235
+ async activationStatus() {
4236
+ return this.backend.activationStatus();
4237
+ }
4238
+ async correctActivationEmail(email, revision) {
4239
+ return this.backend.correctActivationEmail(email, revision);
4240
+ }
4197
4241
  async verify(req) {
4198
4242
  return this.backend.verify(req);
4199
4243
  }
@@ -5737,6 +5781,12 @@ var ExtrovertClient = class _ExtrovertClient {
5737
5781
  * Pending verification is also fail-closed with 403 `signup_disabled` while
5738
5782
  * free signup is paused.
5739
5783
  */
5784
+ activationStatus(signal) {
5785
+ return this.transport.activationStatus(signal);
5786
+ }
5787
+ correctActivationEmail(human_email, revision, signal) {
5788
+ return this.transport.correctActivationEmail(human_email, revision, signal);
5789
+ }
5740
5790
  verify(req, signal) {
5741
5791
  return this.transport.verify(req, signal);
5742
5792
  }
@@ -5904,7 +5954,7 @@ async function signWebhook(secret, body, timestampSeconds) {
5904
5954
  }
5905
5955
 
5906
5956
  // src/contract.ts
5907
- var CONTRACT_VERSION = "0.1.0-pre.16";
5957
+ var CONTRACT_VERSION = "0.1.0-pre.17";
5908
5958
  var CONTRACT_MANIFEST = {
5909
5959
  name: "extrovert.review-loop",
5910
5960
  version: CONTRACT_VERSION,
@@ -5980,6 +6030,26 @@ var CONTRACT_MANIFEST = {
5980
6030
  skills: ["extrovert-send-email", "extrovert-writing-rules"]
5981
6031
  };
5982
6032
 
5983
- export { ADMINISTRATIVE_FIXTURE_KEY, API_VERSION_HEADER, Administration, ApiError, AuthenticationError, BornStaleError, BreadthRequiredError, CONTRACT_MANIFEST, CONTRACT_VERSION, CURRENT_API_VERSION, Categories, Commerce, ConflictError, ConnectionError, ContactLists, DEFAULT_BASE_URL, Domains, ExtrovertClient as Extrovert, ExtrovertClient, ForbiddenScopeError, IdempotencyConflictError, InboxHandle, Inboxes, IntentRequiredError, ListPage, MOCK_BASE_URL, Messages, MockBackend, NotFoundError, PROBLEM_CODES, PaymentRequiredError, PermissionError, ProjectInboxes, Projects, REVIEW_PROBLEM_RETRYABLE, RateLimitError, RecipientSuppressedError, ReviewConflictError, ReviewEvents, Reviews, Rules, SDK_VERSION, SendNeedsReconciliationError, StaleError, Submissions, Suppressions, TerminalError, Threads, TimeoutError, UnavailableError, ValidationError, Webhooks, WrongStateError, extractCredentials, extractLink, extractOtp, isProblemCode, isQueuedForReview, isSentImmediately, listPage, parseKeyTier, parseProblem, parseWebhook, reviewIdOf, sentMessageIdOf, serializeInclude, signWebhook, threadIdOf, tierAllowsOrgWildcard, tierNeedsExplicitBreadth, verifyWebhookSignature };
6033
+ // src/storage.ts
6034
+ function storageWarningFromHeaders(headers) {
6035
+ if (headers.get("x-extrovert-storage-status") !== "available") return;
6036
+ const threshold = Number(headers.get("x-extrovert-storage-threshold"));
6037
+ if (!headers.has("x-extrovert-storage-used-bytes") || !headers.has("x-extrovert-storage-limit-bytes")) return;
6038
+ const used = Number(headers.get("x-extrovert-storage-used-bytes"));
6039
+ const limit = Number(headers.get("x-extrovert-storage-limit-bytes"));
6040
+ if (![90, 95, 99, 100].includes(threshold) || !Number.isSafeInteger(used) || used < 0 || !Number.isSafeInteger(limit) || limit < 0) return;
6041
+ const link = (name) => {
6042
+ const raw = headers.get(name);
6043
+ if (!raw || raw.length > 2048) return;
6044
+ try {
6045
+ const url = new URL(raw);
6046
+ if (url.protocol === "https:" && !url.username && !url.password) return url.href;
6047
+ } catch {
6048
+ }
6049
+ };
6050
+ return { threshold, used_bytes: used, limit_bytes: limit, cleanup_url: link("x-extrovert-storage-cleanup-url"), billing_url: link("x-extrovert-storage-billing-url") };
6051
+ }
6052
+
6053
+ export { ADMINISTRATIVE_FIXTURE_KEY, API_VERSION_HEADER, Administration, ApiError, AuthenticationError, BornStaleError, BreadthRequiredError, CONTRACT_MANIFEST, CONTRACT_VERSION, CURRENT_API_VERSION, Categories, Commerce, ConflictError, ConnectionError, ContactLists, DEFAULT_BASE_URL, Domains, ExtrovertClient as Extrovert, ExtrovertClient, ForbiddenScopeError, IdempotencyConflictError, InboxHandle, Inboxes, IntentRequiredError, ListPage, MOCK_BASE_URL, Messages, MockBackend, NotFoundError, PROBLEM_CODES, PaymentRequiredError, PermissionError, ProjectInboxes, Projects, REVIEW_PROBLEM_RETRYABLE, RateLimitError, RecipientSuppressedError, ReviewConflictError, ReviewEvents, Reviews, Rules, SDK_VERSION, SendNeedsReconciliationError, StaleError, Submissions, Suppressions, TerminalError, Threads, TimeoutError, UnavailableError, ValidationError, Webhooks, WrongStateError, extractCredentials, extractLink, extractOtp, isProblemCode, isQueuedForReview, isSentImmediately, listPage, parseKeyTier, parseProblem, parseWebhook, reviewIdOf, sentMessageIdOf, serializeInclude, signWebhook, storageWarningFromHeaders, threadIdOf, tierAllowsOrgWildcard, tierNeedsExplicitBreadth, verifyWebhookSignature };
5984
6054
  //# sourceMappingURL=index.js.map
5985
6055
  //# sourceMappingURL=index.js.map