@extrovert.dev/sdk 0.1.0-pre.5 → 0.1.0-pre.6
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 +5 -4
- package/dist/index.cjs +23 -5
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +29 -9
- package/dist/index.d.ts +29 -9
- package/dist/index.js +23 -5
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.d.cts
CHANGED
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
* on 429/5xx, honors `Retry-After`, and surfaces every failure as a typed {@link ApiError}.
|
|
7
7
|
*/
|
|
8
8
|
/** The library version, surfaced in the User-Agent. Kept in sync with package.json by build. */
|
|
9
|
-
declare const SDK_VERSION = "0.1.0-pre.
|
|
9
|
+
declare const SDK_VERSION = "0.1.0-pre.6";
|
|
10
10
|
interface RetryOptions {
|
|
11
11
|
/** Max retry attempts for idempotent requests on 429/5xx/network errors. Default 2. */
|
|
12
12
|
maxRetries: number;
|
|
@@ -58,7 +58,7 @@ type IsoTimestamp = string;
|
|
|
58
58
|
* buy a new domain (`POST /v1/domains` with `mode: "purchased"`). `review:act` gates
|
|
59
59
|
* the BYO reviewer decision plane.
|
|
60
60
|
*/
|
|
61
|
-
type Scope = "mailbox:create" | "mailbox:read" | "mailbox:send" | "mailbox:quota" | "mailbox:delete" | "webhook:write" | "domain:manage" | "domain:purchase" | "review:act";
|
|
61
|
+
type Scope = "mailbox:create" | "mailbox:read" | "mailbox:send" | "mailbox:quota" | "mailbox:credentials" | "mailbox:delete" | "webhook:write" | "domain:manage" | "domain:purchase" | "review:act" | "signup:verify";
|
|
62
62
|
/** How a Extrovert domain was onboarded (§7). */
|
|
63
63
|
type OnboardingMode = "shared" | "purchased" | "ns_delegated" | "manual";
|
|
64
64
|
/** Lifecycle status of an agent principal. */
|
|
@@ -520,6 +520,8 @@ interface SendRequest {
|
|
|
520
520
|
* routes to needs_review with gate_outcome `held:low_confidence`.
|
|
521
521
|
*/
|
|
522
522
|
category_confidence?: number;
|
|
523
|
+
/** Opaque token from the fresh getRules call used for this composition. */
|
|
524
|
+
composition_token?: string;
|
|
523
525
|
}
|
|
524
526
|
/**
|
|
525
527
|
* Request body for the canonical thread-aware reply,
|
|
@@ -555,6 +557,7 @@ interface ReplyRequest {
|
|
|
555
557
|
category_id?: string;
|
|
556
558
|
/** Agent-supplied confidence (0..1); see {@link SendRequest.category_confidence}. */
|
|
557
559
|
category_confidence?: number;
|
|
560
|
+
composition_token?: string;
|
|
558
561
|
}
|
|
559
562
|
/**
|
|
560
563
|
* Request body for `POST /v1/inboxes/{addr}/messages/{id}/forward`. Re-sends the
|
|
@@ -589,6 +592,7 @@ interface ForwardRequest {
|
|
|
589
592
|
category_id?: string;
|
|
590
593
|
/** Agent-supplied confidence (0..1); see {@link SendRequest.category_confidence}. */
|
|
591
594
|
category_confidence?: number;
|
|
595
|
+
composition_token?: string;
|
|
592
596
|
/** See {@link SendRequest.idempotency_key} — sent as a header, never in the body. */
|
|
593
597
|
idempotency_key?: string;
|
|
594
598
|
}
|
|
@@ -811,6 +815,8 @@ interface SubmitRevisionRequest {
|
|
|
811
815
|
html?: string;
|
|
812
816
|
built_at?: IsoTimestamp;
|
|
813
817
|
rules_version_seen?: number;
|
|
818
|
+
/** Opaque token from the fresh getRules call used for this redraft. */
|
|
819
|
+
composition_token?: string;
|
|
814
820
|
/**
|
|
815
821
|
* REPLACES the draft's attachments. Omit the field to leave them untouched;
|
|
816
822
|
* send an empty array to clear them.
|
|
@@ -1185,6 +1191,14 @@ interface GetRulesParams {
|
|
|
1185
1191
|
/** Narrow to one layer (general | category). Default returns both. */
|
|
1186
1192
|
scope?: "general" | "category";
|
|
1187
1193
|
}
|
|
1194
|
+
/** Stable effective rule stack plus an opaque proof for the next composition. */
|
|
1195
|
+
interface RuleSnapshot extends Page<Rule> {
|
|
1196
|
+
house_style_version: number;
|
|
1197
|
+
category_rules_version: number;
|
|
1198
|
+
rule_high_water: number;
|
|
1199
|
+
composition_token?: string;
|
|
1200
|
+
composition_token_expires_at?: IsoTimestamp;
|
|
1201
|
+
}
|
|
1188
1202
|
/**
|
|
1189
1203
|
* Save / edit a writing rule (append-only by supersession; spec §5.4; D11).
|
|
1190
1204
|
*
|
|
@@ -1196,6 +1210,8 @@ interface GetRulesParams {
|
|
|
1196
1210
|
* `scope` is the category axis, `rule_layer` is the ownership axis.)
|
|
1197
1211
|
*/
|
|
1198
1212
|
interface SaveRuleRequest {
|
|
1213
|
+
/** Stable retry key, sent as Idempotency-Key and omitted from the JSON body. */
|
|
1214
|
+
idempotency_key?: string;
|
|
1199
1215
|
/** Defaults from category_id (general iff empty). */
|
|
1200
1216
|
scope?: "general" | "category";
|
|
1201
1217
|
/** Category id (cat_…); empty = house-style/general (D2). */
|
|
@@ -1863,7 +1879,7 @@ interface Transport {
|
|
|
1863
1879
|
proposeGraduation(categoryId: string, req: ProposeGraduationRequest, signal?: AbortSignal): Promise<GraduationStatus>;
|
|
1864
1880
|
getScanBacklogStatus(categoryId: string, signal?: AbortSignal): Promise<ScanBacklogStatus>;
|
|
1865
1881
|
getCategoryPacingState(categoryId: string, signal?: AbortSignal): Promise<CategoryPacingState>;
|
|
1866
|
-
getRules(params: GetRulesParams, signal?: AbortSignal): Promise<
|
|
1882
|
+
getRules(params: GetRulesParams, signal?: AbortSignal): Promise<RuleSnapshot>;
|
|
1867
1883
|
saveRule(req: SaveRuleRequest, signal?: AbortSignal): Promise<Rule>;
|
|
1868
1884
|
promoteRule(ruleId: string, toScope: "general" | "category", signal?: AbortSignal): Promise<Rule>;
|
|
1869
1885
|
retireRule(ruleId: string, signal?: AbortSignal): Promise<Rule>;
|
|
@@ -2082,7 +2098,7 @@ declare class MockBackend {
|
|
|
2082
2098
|
/** rank a rule for the §7 ladder (mock mirror of the server's deterministic order). */
|
|
2083
2099
|
private ruleRank;
|
|
2084
2100
|
/** Get the ORDERED active rule set (mock) — §7 ladder + category-before-general. */
|
|
2085
|
-
getRules(params?: GetRulesParams):
|
|
2101
|
+
getRules(params?: GetRulesParams): RuleSnapshot;
|
|
2086
2102
|
/** Save / edit a rule (mock) — append-only by supersession (D11). */
|
|
2087
2103
|
saveRule(req: SaveRuleRequest): Rule;
|
|
2088
2104
|
/** Promote a rule between layers (mock, via supersession), or undefined when unknown. */
|
|
@@ -2999,7 +3015,7 @@ declare class Rules {
|
|
|
2999
3015
|
private readonly ctx;
|
|
3000
3016
|
constructor(ctx: ResourceContext);
|
|
3001
3017
|
/** Get the ORDERED active rule set (precedence ladder applied; NO LLM). */
|
|
3002
|
-
get(params?: GetRulesParams, signal?: AbortSignal): Promise<
|
|
3018
|
+
get(params?: GetRulesParams, signal?: AbortSignal): Promise<RuleSnapshot>;
|
|
3003
3019
|
/**
|
|
3004
3020
|
* Save / edit a rule (append-only by supersession; D11). An agent-plane save is
|
|
3005
3021
|
* ALWAYS project-layer: the saved rule's `rule_layer` is `project`, bound to the
|
|
@@ -3126,6 +3142,8 @@ declare class ExtrovertClient {
|
|
|
3126
3142
|
* + a first inbox and returns a LIMITED-scope (read-only) agent key; a one-time
|
|
3127
3143
|
* code is emailed to `human_email`. Call {@link verify} with the code to unlock
|
|
3128
3144
|
* full scopes. Idempotent on `human_email`: re-calling rotates the key + resends.
|
|
3145
|
+
* When free signup is paused, this throws an `ApiError` with status 403 and
|
|
3146
|
+
* code `signup_disabled` without creating account state.
|
|
3129
3147
|
*/
|
|
3130
3148
|
signUp(req: SignUpRequest, signal?: AbortSignal): Promise<SignUpResponse>;
|
|
3131
3149
|
/**
|
|
@@ -3133,6 +3151,8 @@ declare class ExtrovertClient {
|
|
|
3133
3151
|
* once). Must be called with the limited key from {@link signUp} as the bearer.
|
|
3134
3152
|
* The result repeats the ready inbox address and includes MCP-first list/read/wait
|
|
3135
3153
|
* calls; SDK callers can pass `address` directly to `inboxes` and `messages`.
|
|
3154
|
+
* Pending verification is also fail-closed with 403 `signup_disabled` while
|
|
3155
|
+
* free signup is paused.
|
|
3136
3156
|
*/
|
|
3137
3157
|
verify(req: VerifyRequest, signal?: AbortSignal): Promise<VerifyResponse>;
|
|
3138
3158
|
/** Introspect the principal behind the current key (`GET /v1/auth/me`). */
|
|
@@ -3699,7 +3719,7 @@ declare function signWebhook(secret: string, body: string, timestampSeconds: num
|
|
|
3699
3719
|
*
|
|
3700
3720
|
* ## Provisional, pre-1.0 (0.x)
|
|
3701
3721
|
*
|
|
3702
|
-
* {@link CONTRACT_VERSION} is **`0.1.0-pre.
|
|
3722
|
+
* {@link CONTRACT_VERSION} is **`0.1.0-pre.6`** — a deliberately **provisional**, pre-1.0
|
|
3703
3723
|
* contract. It is open and documented, but it MAY still evolve before 1.0: there
|
|
3704
3724
|
* are no external users yet, and the **D20 shared-pool auto-send governor** is a
|
|
3705
3725
|
* hard prerequisite before onboarding external users. Pin the version; expect
|
|
@@ -3756,12 +3776,12 @@ interface DiffJson {
|
|
|
3756
3776
|
/**
|
|
3757
3777
|
* The published version of the Extrovert Review-Loop open contract (D14).
|
|
3758
3778
|
*
|
|
3759
|
-
* **`0.1.0-pre.
|
|
3779
|
+
* **`0.1.0-pre.6` — PROVISIONAL, pre-1.0.** Versioned *with the SDK* (this package's
|
|
3760
3780
|
* `package.json` version) and aligned to the openapi `info.version`. Open and
|
|
3761
3781
|
* documented, but MAY still evolve before 1.0 (no external users yet; the D20
|
|
3762
3782
|
* shared-pool governor is required before external users). Pin it.
|
|
3763
3783
|
*/
|
|
3764
|
-
declare const CONTRACT_VERSION: "0.1.0-pre.
|
|
3784
|
+
declare const CONTRACT_VERSION: "0.1.0-pre.6";
|
|
3765
3785
|
/** The stability posture of a published contract version. */
|
|
3766
3786
|
type ContractStability = "provisional" | "stable";
|
|
3767
3787
|
/**
|
|
@@ -3804,4 +3824,4 @@ interface ContractManifest {
|
|
|
3804
3824
|
*/
|
|
3805
3825
|
declare const CONTRACT_MANIFEST: ContractManifest;
|
|
3806
3826
|
|
|
3807
|
-
export { API_VERSION_HEADER, type AccountRiskDial, type AckReviewEventEntry, type AckReviewEventRequest, type AckReviewEventResult, type AddContactListRequest, 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, ConflictError, ConnectionError, 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 DomainRecord, type DomainScope, 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 List, type ListCategoriesParams, type ListInboxesParams, type ListMessagesParams, ListPage, type ListParams, type ListReviewEventsParams, type ListReviewsParams, type ListSuppressionsParams, type ListThreadsParams, 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, REVIEW_PROBLEM_RETRYABLE, RateLimitError, RecipientSuppressedError, type RegisterWebhookRequest, type ReplyRequest, 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, Rules, SDK_VERSION, type SaveRuleRequest, type ScanBacklogStatus, type Scope, type SearchMessagesParams, SendNeedsReconciliationError, type SendOutcome, type SendRequest, type SendResult, type SentResult, type SignUpRequest, type SignUpResponse, StaleError, type StreamEvent, type StreamOptions, type SubmitForReviewResult, type SubmitRevisionRequest, type SuppressionEntry, type SuppressionPrecheck, type SuppressionScope, type SuppressionSource, Suppressions, TerminalError, type Thread, type ThreadDetail, Threads, TimeoutError, 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 };
|
|
3827
|
+
export { API_VERSION_HEADER, type AccountRiskDial, type AckReviewEventEntry, type AckReviewEventRequest, type AckReviewEventResult, type AddContactListRequest, 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, ConflictError, ConnectionError, 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 DomainRecord, type DomainScope, 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 List, type ListCategoriesParams, type ListInboxesParams, type ListMessagesParams, ListPage, type ListParams, type ListReviewEventsParams, type ListReviewsParams, type ListSuppressionsParams, type ListThreadsParams, 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, REVIEW_PROBLEM_RETRYABLE, RateLimitError, RecipientSuppressedError, type RegisterWebhookRequest, type ReplyRequest, 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 SentResult, type SignUpRequest, type SignUpResponse, StaleError, type StreamEvent, type StreamOptions, type SubmitForReviewResult, type SubmitRevisionRequest, type SuppressionEntry, type SuppressionPrecheck, type SuppressionScope, type SuppressionSource, Suppressions, TerminalError, type Thread, type ThreadDetail, Threads, TimeoutError, 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 };
|
package/dist/index.d.ts
CHANGED
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
* on 429/5xx, honors `Retry-After`, and surfaces every failure as a typed {@link ApiError}.
|
|
7
7
|
*/
|
|
8
8
|
/** The library version, surfaced in the User-Agent. Kept in sync with package.json by build. */
|
|
9
|
-
declare const SDK_VERSION = "0.1.0-pre.
|
|
9
|
+
declare const SDK_VERSION = "0.1.0-pre.6";
|
|
10
10
|
interface RetryOptions {
|
|
11
11
|
/** Max retry attempts for idempotent requests on 429/5xx/network errors. Default 2. */
|
|
12
12
|
maxRetries: number;
|
|
@@ -58,7 +58,7 @@ type IsoTimestamp = string;
|
|
|
58
58
|
* buy a new domain (`POST /v1/domains` with `mode: "purchased"`). `review:act` gates
|
|
59
59
|
* the BYO reviewer decision plane.
|
|
60
60
|
*/
|
|
61
|
-
type Scope = "mailbox:create" | "mailbox:read" | "mailbox:send" | "mailbox:quota" | "mailbox:delete" | "webhook:write" | "domain:manage" | "domain:purchase" | "review:act";
|
|
61
|
+
type Scope = "mailbox:create" | "mailbox:read" | "mailbox:send" | "mailbox:quota" | "mailbox:credentials" | "mailbox:delete" | "webhook:write" | "domain:manage" | "domain:purchase" | "review:act" | "signup:verify";
|
|
62
62
|
/** How a Extrovert domain was onboarded (§7). */
|
|
63
63
|
type OnboardingMode = "shared" | "purchased" | "ns_delegated" | "manual";
|
|
64
64
|
/** Lifecycle status of an agent principal. */
|
|
@@ -520,6 +520,8 @@ interface SendRequest {
|
|
|
520
520
|
* routes to needs_review with gate_outcome `held:low_confidence`.
|
|
521
521
|
*/
|
|
522
522
|
category_confidence?: number;
|
|
523
|
+
/** Opaque token from the fresh getRules call used for this composition. */
|
|
524
|
+
composition_token?: string;
|
|
523
525
|
}
|
|
524
526
|
/**
|
|
525
527
|
* Request body for the canonical thread-aware reply,
|
|
@@ -555,6 +557,7 @@ interface ReplyRequest {
|
|
|
555
557
|
category_id?: string;
|
|
556
558
|
/** Agent-supplied confidence (0..1); see {@link SendRequest.category_confidence}. */
|
|
557
559
|
category_confidence?: number;
|
|
560
|
+
composition_token?: string;
|
|
558
561
|
}
|
|
559
562
|
/**
|
|
560
563
|
* Request body for `POST /v1/inboxes/{addr}/messages/{id}/forward`. Re-sends the
|
|
@@ -589,6 +592,7 @@ interface ForwardRequest {
|
|
|
589
592
|
category_id?: string;
|
|
590
593
|
/** Agent-supplied confidence (0..1); see {@link SendRequest.category_confidence}. */
|
|
591
594
|
category_confidence?: number;
|
|
595
|
+
composition_token?: string;
|
|
592
596
|
/** See {@link SendRequest.idempotency_key} — sent as a header, never in the body. */
|
|
593
597
|
idempotency_key?: string;
|
|
594
598
|
}
|
|
@@ -811,6 +815,8 @@ interface SubmitRevisionRequest {
|
|
|
811
815
|
html?: string;
|
|
812
816
|
built_at?: IsoTimestamp;
|
|
813
817
|
rules_version_seen?: number;
|
|
818
|
+
/** Opaque token from the fresh getRules call used for this redraft. */
|
|
819
|
+
composition_token?: string;
|
|
814
820
|
/**
|
|
815
821
|
* REPLACES the draft's attachments. Omit the field to leave them untouched;
|
|
816
822
|
* send an empty array to clear them.
|
|
@@ -1185,6 +1191,14 @@ interface GetRulesParams {
|
|
|
1185
1191
|
/** Narrow to one layer (general | category). Default returns both. */
|
|
1186
1192
|
scope?: "general" | "category";
|
|
1187
1193
|
}
|
|
1194
|
+
/** Stable effective rule stack plus an opaque proof for the next composition. */
|
|
1195
|
+
interface RuleSnapshot extends Page<Rule> {
|
|
1196
|
+
house_style_version: number;
|
|
1197
|
+
category_rules_version: number;
|
|
1198
|
+
rule_high_water: number;
|
|
1199
|
+
composition_token?: string;
|
|
1200
|
+
composition_token_expires_at?: IsoTimestamp;
|
|
1201
|
+
}
|
|
1188
1202
|
/**
|
|
1189
1203
|
* Save / edit a writing rule (append-only by supersession; spec §5.4; D11).
|
|
1190
1204
|
*
|
|
@@ -1196,6 +1210,8 @@ interface GetRulesParams {
|
|
|
1196
1210
|
* `scope` is the category axis, `rule_layer` is the ownership axis.)
|
|
1197
1211
|
*/
|
|
1198
1212
|
interface SaveRuleRequest {
|
|
1213
|
+
/** Stable retry key, sent as Idempotency-Key and omitted from the JSON body. */
|
|
1214
|
+
idempotency_key?: string;
|
|
1199
1215
|
/** Defaults from category_id (general iff empty). */
|
|
1200
1216
|
scope?: "general" | "category";
|
|
1201
1217
|
/** Category id (cat_…); empty = house-style/general (D2). */
|
|
@@ -1863,7 +1879,7 @@ interface Transport {
|
|
|
1863
1879
|
proposeGraduation(categoryId: string, req: ProposeGraduationRequest, signal?: AbortSignal): Promise<GraduationStatus>;
|
|
1864
1880
|
getScanBacklogStatus(categoryId: string, signal?: AbortSignal): Promise<ScanBacklogStatus>;
|
|
1865
1881
|
getCategoryPacingState(categoryId: string, signal?: AbortSignal): Promise<CategoryPacingState>;
|
|
1866
|
-
getRules(params: GetRulesParams, signal?: AbortSignal): Promise<
|
|
1882
|
+
getRules(params: GetRulesParams, signal?: AbortSignal): Promise<RuleSnapshot>;
|
|
1867
1883
|
saveRule(req: SaveRuleRequest, signal?: AbortSignal): Promise<Rule>;
|
|
1868
1884
|
promoteRule(ruleId: string, toScope: "general" | "category", signal?: AbortSignal): Promise<Rule>;
|
|
1869
1885
|
retireRule(ruleId: string, signal?: AbortSignal): Promise<Rule>;
|
|
@@ -2082,7 +2098,7 @@ declare class MockBackend {
|
|
|
2082
2098
|
/** rank a rule for the §7 ladder (mock mirror of the server's deterministic order). */
|
|
2083
2099
|
private ruleRank;
|
|
2084
2100
|
/** Get the ORDERED active rule set (mock) — §7 ladder + category-before-general. */
|
|
2085
|
-
getRules(params?: GetRulesParams):
|
|
2101
|
+
getRules(params?: GetRulesParams): RuleSnapshot;
|
|
2086
2102
|
/** Save / edit a rule (mock) — append-only by supersession (D11). */
|
|
2087
2103
|
saveRule(req: SaveRuleRequest): Rule;
|
|
2088
2104
|
/** Promote a rule between layers (mock, via supersession), or undefined when unknown. */
|
|
@@ -2999,7 +3015,7 @@ declare class Rules {
|
|
|
2999
3015
|
private readonly ctx;
|
|
3000
3016
|
constructor(ctx: ResourceContext);
|
|
3001
3017
|
/** Get the ORDERED active rule set (precedence ladder applied; NO LLM). */
|
|
3002
|
-
get(params?: GetRulesParams, signal?: AbortSignal): Promise<
|
|
3018
|
+
get(params?: GetRulesParams, signal?: AbortSignal): Promise<RuleSnapshot>;
|
|
3003
3019
|
/**
|
|
3004
3020
|
* Save / edit a rule (append-only by supersession; D11). An agent-plane save is
|
|
3005
3021
|
* ALWAYS project-layer: the saved rule's `rule_layer` is `project`, bound to the
|
|
@@ -3126,6 +3142,8 @@ declare class ExtrovertClient {
|
|
|
3126
3142
|
* + a first inbox and returns a LIMITED-scope (read-only) agent key; a one-time
|
|
3127
3143
|
* code is emailed to `human_email`. Call {@link verify} with the code to unlock
|
|
3128
3144
|
* full scopes. Idempotent on `human_email`: re-calling rotates the key + resends.
|
|
3145
|
+
* When free signup is paused, this throws an `ApiError` with status 403 and
|
|
3146
|
+
* code `signup_disabled` without creating account state.
|
|
3129
3147
|
*/
|
|
3130
3148
|
signUp(req: SignUpRequest, signal?: AbortSignal): Promise<SignUpResponse>;
|
|
3131
3149
|
/**
|
|
@@ -3133,6 +3151,8 @@ declare class ExtrovertClient {
|
|
|
3133
3151
|
* once). Must be called with the limited key from {@link signUp} as the bearer.
|
|
3134
3152
|
* The result repeats the ready inbox address and includes MCP-first list/read/wait
|
|
3135
3153
|
* calls; SDK callers can pass `address` directly to `inboxes` and `messages`.
|
|
3154
|
+
* Pending verification is also fail-closed with 403 `signup_disabled` while
|
|
3155
|
+
* free signup is paused.
|
|
3136
3156
|
*/
|
|
3137
3157
|
verify(req: VerifyRequest, signal?: AbortSignal): Promise<VerifyResponse>;
|
|
3138
3158
|
/** Introspect the principal behind the current key (`GET /v1/auth/me`). */
|
|
@@ -3699,7 +3719,7 @@ declare function signWebhook(secret: string, body: string, timestampSeconds: num
|
|
|
3699
3719
|
*
|
|
3700
3720
|
* ## Provisional, pre-1.0 (0.x)
|
|
3701
3721
|
*
|
|
3702
|
-
* {@link CONTRACT_VERSION} is **`0.1.0-pre.
|
|
3722
|
+
* {@link CONTRACT_VERSION} is **`0.1.0-pre.6`** — a deliberately **provisional**, pre-1.0
|
|
3703
3723
|
* contract. It is open and documented, but it MAY still evolve before 1.0: there
|
|
3704
3724
|
* are no external users yet, and the **D20 shared-pool auto-send governor** is a
|
|
3705
3725
|
* hard prerequisite before onboarding external users. Pin the version; expect
|
|
@@ -3756,12 +3776,12 @@ interface DiffJson {
|
|
|
3756
3776
|
/**
|
|
3757
3777
|
* The published version of the Extrovert Review-Loop open contract (D14).
|
|
3758
3778
|
*
|
|
3759
|
-
* **`0.1.0-pre.
|
|
3779
|
+
* **`0.1.0-pre.6` — PROVISIONAL, pre-1.0.** Versioned *with the SDK* (this package's
|
|
3760
3780
|
* `package.json` version) and aligned to the openapi `info.version`. Open and
|
|
3761
3781
|
* documented, but MAY still evolve before 1.0 (no external users yet; the D20
|
|
3762
3782
|
* shared-pool governor is required before external users). Pin it.
|
|
3763
3783
|
*/
|
|
3764
|
-
declare const CONTRACT_VERSION: "0.1.0-pre.
|
|
3784
|
+
declare const CONTRACT_VERSION: "0.1.0-pre.6";
|
|
3765
3785
|
/** The stability posture of a published contract version. */
|
|
3766
3786
|
type ContractStability = "provisional" | "stable";
|
|
3767
3787
|
/**
|
|
@@ -3804,4 +3824,4 @@ interface ContractManifest {
|
|
|
3804
3824
|
*/
|
|
3805
3825
|
declare const CONTRACT_MANIFEST: ContractManifest;
|
|
3806
3826
|
|
|
3807
|
-
export { API_VERSION_HEADER, type AccountRiskDial, type AckReviewEventEntry, type AckReviewEventRequest, type AckReviewEventResult, type AddContactListRequest, 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, ConflictError, ConnectionError, 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 DomainRecord, type DomainScope, 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 List, type ListCategoriesParams, type ListInboxesParams, type ListMessagesParams, ListPage, type ListParams, type ListReviewEventsParams, type ListReviewsParams, type ListSuppressionsParams, type ListThreadsParams, 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, REVIEW_PROBLEM_RETRYABLE, RateLimitError, RecipientSuppressedError, type RegisterWebhookRequest, type ReplyRequest, 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, Rules, SDK_VERSION, type SaveRuleRequest, type ScanBacklogStatus, type Scope, type SearchMessagesParams, SendNeedsReconciliationError, type SendOutcome, type SendRequest, type SendResult, type SentResult, type SignUpRequest, type SignUpResponse, StaleError, type StreamEvent, type StreamOptions, type SubmitForReviewResult, type SubmitRevisionRequest, type SuppressionEntry, type SuppressionPrecheck, type SuppressionScope, type SuppressionSource, Suppressions, TerminalError, type Thread, type ThreadDetail, Threads, TimeoutError, 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 };
|
|
3827
|
+
export { API_VERSION_HEADER, type AccountRiskDial, type AckReviewEventEntry, type AckReviewEventRequest, type AckReviewEventResult, type AddContactListRequest, 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, ConflictError, ConnectionError, 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 DomainRecord, type DomainScope, 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 List, type ListCategoriesParams, type ListInboxesParams, type ListMessagesParams, ListPage, type ListParams, type ListReviewEventsParams, type ListReviewsParams, type ListSuppressionsParams, type ListThreadsParams, 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, REVIEW_PROBLEM_RETRYABLE, RateLimitError, RecipientSuppressedError, type RegisterWebhookRequest, type ReplyRequest, 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 SentResult, type SignUpRequest, type SignUpResponse, StaleError, type StreamEvent, type StreamOptions, type SubmitForReviewResult, type SubmitRevisionRequest, type SuppressionEntry, type SuppressionPrecheck, type SuppressionScope, type SuppressionSource, Suppressions, TerminalError, type Thread, type ThreadDetail, Threads, TimeoutError, 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 };
|
package/dist/index.js
CHANGED
|
@@ -266,7 +266,7 @@ var CURRENT_API_VERSION = "2026-06-23";
|
|
|
266
266
|
var API_VERSION_HEADER = "Extrovert-Version";
|
|
267
267
|
|
|
268
268
|
// src/http.ts
|
|
269
|
-
var SDK_VERSION = "0.1.0-pre.
|
|
269
|
+
var SDK_VERSION = "0.1.0-pre.6";
|
|
270
270
|
function buildUrl(baseUrl, path, query) {
|
|
271
271
|
const base = baseUrl.endsWith("/") ? baseUrl.slice(0, -1) : baseUrl;
|
|
272
272
|
const rel = path.startsWith("/") ? path : `/${path}`;
|
|
@@ -957,7 +957,7 @@ var MockBackend = class {
|
|
|
957
957
|
agent_id: agentId,
|
|
958
958
|
agent_key: `pk_agent_${agentId.slice(4)}_${rid("sk").slice(3)}`,
|
|
959
959
|
key_prefix: `pk_agent_${agentId.slice(4, 8)}`,
|
|
960
|
-
scopes: ["
|
|
960
|
+
scopes: ["signup:verify"],
|
|
961
961
|
address,
|
|
962
962
|
verified: false,
|
|
963
963
|
otp_sent_to: email,
|
|
@@ -1988,7 +1988,15 @@ var MockBackend = class {
|
|
|
1988
1988
|
category = active.filter((r) => r.scope === "category" && r.category_id === params.category_id).sort(byRank);
|
|
1989
1989
|
}
|
|
1990
1990
|
const items = [...category, ...general];
|
|
1991
|
-
return {
|
|
1991
|
+
return {
|
|
1992
|
+
items,
|
|
1993
|
+
total: items.length,
|
|
1994
|
+
house_style_version: 1,
|
|
1995
|
+
category_rules_version: params.category_id ? 1 : 0,
|
|
1996
|
+
rule_high_water: params.category_id ? 1 : 0,
|
|
1997
|
+
composition_token: params.scope ? void 0 : `cmp_fixture_${params.category_id ?? "general"}`,
|
|
1998
|
+
composition_token_expires_at: params.scope ? void 0 : new Date(Date.now() + 6e5).toISOString()
|
|
1999
|
+
};
|
|
1992
2000
|
}
|
|
1993
2001
|
/** Save / edit a rule (mock) — append-only by supersession (D11). */
|
|
1994
2002
|
saveRule(req) {
|
|
@@ -3596,7 +3604,13 @@ var HttpTransport = class {
|
|
|
3596
3604
|
});
|
|
3597
3605
|
}
|
|
3598
3606
|
saveRule(req, signal) {
|
|
3599
|
-
return this.call({
|
|
3607
|
+
return this.call({
|
|
3608
|
+
method: "PUT",
|
|
3609
|
+
path: "/v1/rules",
|
|
3610
|
+
body: withoutIdempotencyKey(req),
|
|
3611
|
+
idempotencyKey: req.idempotency_key,
|
|
3612
|
+
signal
|
|
3613
|
+
});
|
|
3600
3614
|
}
|
|
3601
3615
|
promoteRule(ruleId, toScope, signal) {
|
|
3602
3616
|
return this.call({
|
|
@@ -4993,6 +5007,8 @@ var ExtrovertClient = class _ExtrovertClient {
|
|
|
4993
5007
|
* + a first inbox and returns a LIMITED-scope (read-only) agent key; a one-time
|
|
4994
5008
|
* code is emailed to `human_email`. Call {@link verify} with the code to unlock
|
|
4995
5009
|
* full scopes. Idempotent on `human_email`: re-calling rotates the key + resends.
|
|
5010
|
+
* When free signup is paused, this throws an `ApiError` with status 403 and
|
|
5011
|
+
* code `signup_disabled` without creating account state.
|
|
4996
5012
|
*/
|
|
4997
5013
|
signUp(req, signal) {
|
|
4998
5014
|
return this.transport.signUp(req, signal);
|
|
@@ -5002,6 +5018,8 @@ var ExtrovertClient = class _ExtrovertClient {
|
|
|
5002
5018
|
* once). Must be called with the limited key from {@link signUp} as the bearer.
|
|
5003
5019
|
* The result repeats the ready inbox address and includes MCP-first list/read/wait
|
|
5004
5020
|
* calls; SDK callers can pass `address` directly to `inboxes` and `messages`.
|
|
5021
|
+
* Pending verification is also fail-closed with 403 `signup_disabled` while
|
|
5022
|
+
* free signup is paused.
|
|
5005
5023
|
*/
|
|
5006
5024
|
verify(req, signal) {
|
|
5007
5025
|
return this.transport.verify(req, signal);
|
|
@@ -5169,7 +5187,7 @@ async function signWebhook(secret, body, timestampSeconds) {
|
|
|
5169
5187
|
}
|
|
5170
5188
|
|
|
5171
5189
|
// src/contract.ts
|
|
5172
|
-
var CONTRACT_VERSION = "0.1.0-pre.
|
|
5190
|
+
var CONTRACT_VERSION = "0.1.0-pre.6";
|
|
5173
5191
|
var CONTRACT_MANIFEST = {
|
|
5174
5192
|
name: "extrovert.review-loop",
|
|
5175
5193
|
version: CONTRACT_VERSION,
|