@rolino/contracts 0.6.0 → 0.7.1
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/CHANGELOG.md +14 -0
- package/LICENSE +1 -1
- package/README.md +2 -0
- package/dist/index.cjs +197 -6
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +1288 -135
- package/dist/index.d.ts +1288 -135
- package/dist/index.js +163 -6
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
// src/index.ts
|
|
2
2
|
import { z } from "zod";
|
|
3
3
|
var API_VERSION = "v1";
|
|
4
|
-
var CONTRACT_VERSION = "0.
|
|
4
|
+
var CONTRACT_VERSION = "0.18.0";
|
|
5
5
|
var RequestMetadataSchema = z.object({
|
|
6
6
|
requestId: z.string().min(1)
|
|
7
7
|
});
|
|
@@ -95,12 +95,16 @@ var CapabilityIdSchema = z.enum([
|
|
|
95
95
|
"integrations:read",
|
|
96
96
|
"calendar:read",
|
|
97
97
|
"seo:read",
|
|
98
|
+
"backlinks:read",
|
|
99
|
+
"backlinks:write",
|
|
100
|
+
"backlinks:contacts",
|
|
98
101
|
"blog:read",
|
|
99
102
|
"blog:write",
|
|
100
103
|
"blog:manage",
|
|
101
104
|
"blog:approve",
|
|
102
105
|
"blog:publish"
|
|
103
106
|
]);
|
|
107
|
+
var AGENT_CAPABILITIES = CapabilityIdSchema.options;
|
|
104
108
|
var AgentBlogPlanSchema = z.object({
|
|
105
109
|
id: z.string().min(1),
|
|
106
110
|
version: z.number().int().positive(),
|
|
@@ -109,7 +113,8 @@ var AgentBlogPlanSchema = z.object({
|
|
|
109
113
|
windowEnd: z.string().datetime(),
|
|
110
114
|
cadence: z.object({ weekdays: z.array(z.number().int().min(0).max(6)) }),
|
|
111
115
|
activeRevisionId: z.string().nullable(),
|
|
112
|
-
itemCount: z.number().int().nonnegative()
|
|
116
|
+
itemCount: z.number().int().nonnegative(),
|
|
117
|
+
successorState: z.enum(["NOT_STARTED", "GENERATING", "READY", "NEEDS_ATTENTION"]).optional()
|
|
113
118
|
});
|
|
114
119
|
var AgentBlogArticleSchema = z.object({
|
|
115
120
|
id: z.string().min(1),
|
|
@@ -120,8 +125,34 @@ var AgentBlogArticleSchema = z.object({
|
|
|
120
125
|
approvedRevisionId: z.string().nullable(),
|
|
121
126
|
publishedRevisionId: z.string().nullable(),
|
|
122
127
|
scheduledPublishAt: z.string().datetime().nullable(),
|
|
123
|
-
updatedAt: z.string().datetime()
|
|
128
|
+
updatedAt: z.string().datetime(),
|
|
129
|
+
preparationState: z.enum(["PREPARING", "READY_FOR_REVIEW", "SCHEDULED", "MEASURING", "NEEDS_ATTENTION"]).optional(),
|
|
130
|
+
nextAction: z.enum(["WAIT", "REVIEW_ARTICLE", "OPEN_SCHEDULE", "VIEW_OBSERVATION", "RESOLVE_ISSUE"]).optional()
|
|
124
131
|
});
|
|
132
|
+
var AgentBlogArticleQualitySummarySchema = z.object({
|
|
133
|
+
version: z.literal(2),
|
|
134
|
+
decision: z.enum(["READY_FOR_REVIEW", "NEEDS_ATTENTION"]),
|
|
135
|
+
checks: z.array(z.object({ code: z.enum(["SAFE_MARKDOWN", "REQUIRED_METADATA", "CANONICAL_PATH", "CATALOG_LINKS", "LIVE_LINK_TARGETS", "QUERY_OWNERSHIP", "CONTENT_OVERLAP", "BRAND_TERMS", "EVIDENCE_OWNERSHIP"]), status: z.enum(["PASSED", "FAILED", "WARNING"]), message: z.string().max(240) }).strict()).max(9)
|
|
136
|
+
}).strict();
|
|
137
|
+
var AgentBlogMetricSourceSchema = z.object({
|
|
138
|
+
provider: z.enum(["GOOGLE_SEARCH_CONSOLE", "GOOGLE_ANALYTICS"]),
|
|
139
|
+
observedAt: z.string().datetime(),
|
|
140
|
+
periodStart: z.string().datetime().nullable(),
|
|
141
|
+
periodEnd: z.string().datetime().nullable(),
|
|
142
|
+
metrics: z.record(z.string().max(40), z.number().finite()).refine((metrics) => Object.keys(metrics).length <= 20, { message: "Blog metric sources can contain at most 20 metrics." })
|
|
143
|
+
}).strict();
|
|
144
|
+
var AgentBlogPerformanceObservationSchema = z.object({
|
|
145
|
+
state: z.enum(["WAITING", "MATCHED", "MISSING_MATCH", "MEASURING", "OBSERVED", "PARTIAL", "UNAVAILABLE", "STALE"]),
|
|
146
|
+
latestCheckpoint: z.enum(["BASELINE", "DAY_28", "DAY_56"]).nullable(),
|
|
147
|
+
nextCheckpoint: z.enum(["BASELINE", "DAY_28", "DAY_56"]).nullable(),
|
|
148
|
+
checkpoints: z.array(z.object({
|
|
149
|
+
checkpoint: z.enum(["BASELINE", "DAY_28", "DAY_56"]),
|
|
150
|
+
state: z.enum(["WAITING", "MATCHED", "MISSING_MATCH", "MEASURING", "OBSERVED", "PARTIAL", "UNAVAILABLE", "STALE"]),
|
|
151
|
+
targetDataThrough: z.string().date().nullable(),
|
|
152
|
+
sources: z.array(AgentBlogMetricSourceSchema).max(2),
|
|
153
|
+
siteContext: z.array(AgentBlogMetricSourceSchema).max(2)
|
|
154
|
+
}).strict()).max(3)
|
|
155
|
+
}).strict();
|
|
125
156
|
var AgentBlogImageSchema = z.object({
|
|
126
157
|
id: z.string().min(1),
|
|
127
158
|
revisionId: z.string().nullable(),
|
|
@@ -153,8 +184,9 @@ var AgentBlogArticleDetailSchema = AgentBlogArticleSchema.extend({
|
|
|
153
184
|
callToAction: z.unknown().nullable(),
|
|
154
185
|
internalLinks: z.unknown()
|
|
155
186
|
}).nullable(),
|
|
156
|
-
revisions: z.array(z.object({ id: z.string().min(1), revisionNumber: z.number().int().positive(), contentHash: z.string().min(1), approvedAt: z.string().datetime().nullable(), createdAt: z.string().datetime() })),
|
|
157
|
-
images: z.array(AgentBlogImageSchema)
|
|
187
|
+
revisions: z.array(z.object({ id: z.string().min(1), revisionNumber: z.number().int().positive(), contentHash: z.string().min(1), approvedAt: z.string().datetime().nullable(), createdAt: z.string().datetime(), quality: AgentBlogArticleQualitySummarySchema.nullable().optional() })),
|
|
188
|
+
images: z.array(AgentBlogImageSchema),
|
|
189
|
+
measurement: AgentBlogPerformanceObservationSchema.nullable().optional()
|
|
158
190
|
});
|
|
159
191
|
var AgentBlogJobSchema = z.object({
|
|
160
192
|
id: z.string().min(1),
|
|
@@ -444,7 +476,9 @@ var AgentBlogPlanItemSchema = z.object({
|
|
|
444
476
|
existingArticleComparison: z.string().nullable(),
|
|
445
477
|
recommendedLinks: z.unknown(),
|
|
446
478
|
targetConversionPage: z.string().nullable(),
|
|
447
|
-
articleId: z.string().min(1).nullable()
|
|
479
|
+
articleId: z.string().min(1).nullable(),
|
|
480
|
+
preparationState: z.enum(["PREPARING", "READY_FOR_REVIEW", "SCHEDULED", "MEASURING", "NEEDS_ATTENTION"]).optional(),
|
|
481
|
+
nextAction: z.enum(["WAIT", "REVIEW_ARTICLE", "OPEN_SCHEDULE", "VIEW_OBSERVATION", "RESOLVE_ISSUE"]).optional()
|
|
448
482
|
}).strict();
|
|
449
483
|
var AgentBlogPlanItemStateRequestSchema = z.object({
|
|
450
484
|
state: z.enum(["ACCEPTED", "DISMISSED"]),
|
|
@@ -1678,7 +1712,97 @@ var SeoReportListResponseSchema = successEnvelopeSchema(
|
|
|
1678
1712
|
SeoReportListDataSchema
|
|
1679
1713
|
);
|
|
1680
1714
|
var SeoReportResponseSchema = successEnvelopeSchema(SeoReportSchema);
|
|
1715
|
+
var BacklinkOpportunityTypeSchema = z.enum(["TOOL_ROUNDUP", "COMPARISON", "RESOURCE_PAGE", "RELEVANT_ARTICLE"]);
|
|
1716
|
+
var BacklinkProspectStageSchema = z.enum(["NEW", "APPROVED", "CONTACT_RESEARCHING", "REVIEW_OUTREACH", "READY_TO_CONTACT", "CONTACTED", "REPLIED", "LINK_WON", "REJECTED", "NO_CONTACT", "DECLINED"]);
|
|
1717
|
+
var BacklinkNextActionSchema = z.enum(["REVIEW", "FIND_CONTACT", "VIEW_PROGRESS", "REVIEW_OUTREACH", "COPY_OUTREACH", "RETRY_CONTACT", "OPEN"]);
|
|
1718
|
+
var BacklinkContactStateSchema = z.enum(["PUBLIC_CONFIRMED", "GENERIC_PUBLIC", "NOT_FOUND", "STALE"]);
|
|
1719
|
+
var BacklinkVerificationStateSchema = z.enum(["QUEUED", "CHECKING", "VERIFIED", "MISSING", "BLOCKED", "FAILED"]);
|
|
1720
|
+
var BacklinkScoreReasonSchema = z.object({ score: z.number().int().min(0).max(100), reason: z.string().min(1).max(500) }).strict();
|
|
1721
|
+
var BacklinkScoreComponentsSchema = z.object({
|
|
1722
|
+
topicalRelevance: BacklinkScoreReasonSchema,
|
|
1723
|
+
editorialFit: BacklinkScoreReasonSchema,
|
|
1724
|
+
pageFreshness: BacklinkScoreReasonSchema,
|
|
1725
|
+
siteLegitimacy: BacklinkScoreReasonSchema,
|
|
1726
|
+
outreachFeasibility: BacklinkScoreReasonSchema.optional(),
|
|
1727
|
+
publisherType: z.enum([
|
|
1728
|
+
"INDEPENDENT_PUBLISHER",
|
|
1729
|
+
"PROFESSIONAL_ORGANIZATION",
|
|
1730
|
+
"EDUCATIONAL_ORGANIZATION",
|
|
1731
|
+
"AGENCY_OR_ECOSYSTEM",
|
|
1732
|
+
"REVIEW_OR_DIRECTORY",
|
|
1733
|
+
"PRODUCT_VENDOR",
|
|
1734
|
+
"MARKETPLACE",
|
|
1735
|
+
"COMMUNITY",
|
|
1736
|
+
"OWNED",
|
|
1737
|
+
"UNKNOWN"
|
|
1738
|
+
]).optional(),
|
|
1739
|
+
difficulty: z.enum(["EASY", "MEDIUM", "HARD"]).optional(),
|
|
1740
|
+
productClaimsToVerify: z.array(z.string().min(1).max(300)).max(10).optional()
|
|
1741
|
+
}).strict();
|
|
1742
|
+
var BacklinkProspectSchema = z.object({
|
|
1743
|
+
id: SeoEntityIdSchema,
|
|
1744
|
+
projectId: SeoEntityIdSchema,
|
|
1745
|
+
url: z.string().url().max(2048),
|
|
1746
|
+
domain: z.string().min(1).max(253),
|
|
1747
|
+
title: z.string().min(1).max(300),
|
|
1748
|
+
opportunityType: BacklinkOpportunityTypeSchema,
|
|
1749
|
+
stage: BacklinkProspectStageSchema,
|
|
1750
|
+
version: z.number().int().positive(),
|
|
1751
|
+
nextAction: BacklinkNextActionSchema,
|
|
1752
|
+
score: z.number().int().min(0).max(100),
|
|
1753
|
+
scoreComponents: BacklinkScoreComponentsSchema,
|
|
1754
|
+
evidenceExcerpt: z.string().min(1).max(2e3),
|
|
1755
|
+
evidenceSourceUrl: z.string().url().max(2048),
|
|
1756
|
+
suggestedTargetUrl: z.string().url().max(2048),
|
|
1757
|
+
placementAngle: z.string().min(1).max(1e3),
|
|
1758
|
+
contactState: BacklinkContactStateSchema,
|
|
1759
|
+
lastCheckedAt: z.string().datetime(),
|
|
1760
|
+
createdAt: z.string().datetime(),
|
|
1761
|
+
updatedAt: z.string().datetime()
|
|
1762
|
+
}).strict();
|
|
1763
|
+
var BacklinkProspectListQuerySchema = z.object({
|
|
1764
|
+
limit: z.coerce.number().int().min(1).max(50).default(20),
|
|
1765
|
+
cursor: SeoCursorSchema.optional(),
|
|
1766
|
+
stage: BacklinkProspectStageSchema.optional(),
|
|
1767
|
+
opportunityType: BacklinkOpportunityTypeSchema.optional()
|
|
1768
|
+
}).strict();
|
|
1769
|
+
var BacklinkProspectListDataSchema = z.object({
|
|
1770
|
+
items: z.array(BacklinkProspectSchema).max(50),
|
|
1771
|
+
page: z.object({ limit: z.number().int().min(1).max(50), nextCursor: SeoCursorSchema.nullable() }).strict()
|
|
1772
|
+
}).strict();
|
|
1773
|
+
var BacklinkProspectListResponseSchema = successEnvelopeSchema(BacklinkProspectListDataSchema);
|
|
1774
|
+
var BacklinkProspectResponseSchema = successEnvelopeSchema(BacklinkProspectSchema);
|
|
1775
|
+
var BacklinkTargetInputSchema = z.object({ url: z.string().url().max(2048), label: z.string().trim().min(1).max(120), topicSummary: z.string().trim().min(1).max(500).optional() }).strict();
|
|
1776
|
+
var BacklinkDiscoveryInputSchema = z.object({ limit: z.number().int().min(1).max(20).default(20) }).strict();
|
|
1777
|
+
var BacklinkStageUpdateInputSchema = z.object({ stage: BacklinkProspectStageSchema, expectedVersion: z.number().int().positive() }).strict();
|
|
1778
|
+
var BacklinkVerificationInputSchema = z.object({ url: z.string().url().max(2048), expectedVersion: z.number().int().positive() }).strict();
|
|
1779
|
+
var BacklinkOutreachUpdateInputSchema = z.object({ expectedVersion: z.number().int().positive(), subject: z.string().trim().min(1).max(200), body: z.string().trim().min(1).max(3e3) }).strict();
|
|
1780
|
+
var BacklinkTargetSchema = z.object({ id: SeoEntityIdSchema, projectId: SeoEntityIdSchema, normalizedUrl: z.string().url().max(2048), label: z.string().min(1).max(120), topicSummary: z.string().max(500).nullable(), enabled: z.boolean(), createdAt: z.string().datetime(), updatedAt: z.string().datetime() }).strict();
|
|
1781
|
+
var BacklinkTargetListResponseSchema = successEnvelopeSchema(z.array(BacklinkTargetSchema).max(10));
|
|
1782
|
+
var BacklinkTargetResponseSchema = successEnvelopeSchema(BacklinkTargetSchema);
|
|
1783
|
+
var BacklinkDiscoveryRunSchema = z.object({ id: SeoEntityIdSchema, projectId: SeoEntityIdSchema, status: z.enum(["QUEUED", "RUNNING", "SUCCEEDED", "PARTIAL", "FAILED", "CANCELLED"]), promptVersion: z.number().int().positive(), configurationVersion: z.number().int().positive(), searchedCount: z.number().int().nonnegative(), fetchedCount: z.number().int().nonnegative(), savedCount: z.number().int().nonnegative(), failedCount: z.number().int().nonnegative(), safeErrorCode: z.string().max(100).nullable(), createdAt: z.string().datetime(), updatedAt: z.string().datetime() }).strict();
|
|
1784
|
+
var BacklinkDiscoveryRunResponseSchema = successEnvelopeSchema(BacklinkDiscoveryRunSchema);
|
|
1785
|
+
var BacklinkQueueResponseSchema = successEnvelopeSchema(z.object({ prospectId: SeoEntityIdSchema, status: z.literal("QUEUED") }).strict());
|
|
1786
|
+
var BacklinkVerificationSchema = z.object({ id: SeoEntityIdSchema, prospectId: SeoEntityIdSchema, state: BacklinkVerificationStateSchema, submittedUrl: z.string().url(), expectedTargetUrl: z.string().url() }).strict();
|
|
1787
|
+
var BacklinkVerificationResponseSchema = successEnvelopeSchema(BacklinkVerificationSchema);
|
|
1788
|
+
var BacklinkOutreachDraftSchema = z.object({ id: SeoEntityIdSchema, prospectId: SeoEntityIdSchema, version: z.number().int().positive(), subject: z.string().max(200), body: z.string().max(3e3) }).strict();
|
|
1789
|
+
var BacklinkOutreachDraftResponseSchema = successEnvelopeSchema(BacklinkOutreachDraftSchema);
|
|
1790
|
+
var BacklinkContactSchema = z.object({
|
|
1791
|
+
prospectId: SeoEntityIdSchema,
|
|
1792
|
+
name: z.string().max(160).nullable(),
|
|
1793
|
+
role: z.string().max(120).nullable(),
|
|
1794
|
+
email: z.string().email().max(320),
|
|
1795
|
+
evidenceState: BacklinkContactStateSchema.exclude(["NOT_FOUND"]),
|
|
1796
|
+
sourceUrl: z.string().url().max(2048),
|
|
1797
|
+
evidenceExcerpt: z.string().min(1).max(1e3),
|
|
1798
|
+
checkedAt: z.string().datetime(),
|
|
1799
|
+
draft: z.object({ version: z.number().int().positive(), subject: z.string().max(200), body: z.string().max(3e3) }).strict().nullable()
|
|
1800
|
+
}).strict();
|
|
1801
|
+
var BacklinkContactListDataSchema = z.object({ items: z.array(BacklinkContactSchema).max(50), page: z.object({ limit: z.number().int().min(1).max(50), nextCursor: SeoCursorSchema.nullable() }).strict() }).strict();
|
|
1802
|
+
var BacklinkContactListQuerySchema = z.object({ limit: z.coerce.number().int().min(1).max(50).default(20), cursor: SeoCursorSchema.optional() }).strict();
|
|
1803
|
+
var BacklinkContactListResponseSchema = successEnvelopeSchema(BacklinkContactListDataSchema);
|
|
1681
1804
|
export {
|
|
1805
|
+
AGENT_CAPABILITIES,
|
|
1682
1806
|
API_VERSION,
|
|
1683
1807
|
ActorSchema,
|
|
1684
1808
|
AgentBlogApprovalExecuteRequestSchema,
|
|
@@ -1692,6 +1816,7 @@ export {
|
|
|
1692
1816
|
AgentBlogArticleCreateRequestSchema,
|
|
1693
1817
|
AgentBlogArticleDetailSchema,
|
|
1694
1818
|
AgentBlogArticleListResponseSchema,
|
|
1819
|
+
AgentBlogArticleQualitySummarySchema,
|
|
1695
1820
|
AgentBlogArticleQueuedResponseSchema,
|
|
1696
1821
|
AgentBlogArticleResponseSchema,
|
|
1697
1822
|
AgentBlogArticleSchema,
|
|
@@ -1721,6 +1846,8 @@ export {
|
|
|
1721
1846
|
AgentBlogImageUploadPrepareRequestSchema,
|
|
1722
1847
|
AgentBlogJobResponseSchema,
|
|
1723
1848
|
AgentBlogJobSchema,
|
|
1849
|
+
AgentBlogMetricSourceSchema,
|
|
1850
|
+
AgentBlogPerformanceObservationSchema,
|
|
1724
1851
|
AgentBlogPlanCadenceExecuteRequestSchema,
|
|
1725
1852
|
AgentBlogPlanCadenceExecuteResponseSchema,
|
|
1726
1853
|
AgentBlogPlanCadenceExecuteSchema,
|
|
@@ -1786,6 +1913,36 @@ export {
|
|
|
1786
1913
|
ApiMetaSchema,
|
|
1787
1914
|
ApiProblemSchema,
|
|
1788
1915
|
AuthenticationKindSchema,
|
|
1916
|
+
BacklinkContactListDataSchema,
|
|
1917
|
+
BacklinkContactListQuerySchema,
|
|
1918
|
+
BacklinkContactListResponseSchema,
|
|
1919
|
+
BacklinkContactSchema,
|
|
1920
|
+
BacklinkContactStateSchema,
|
|
1921
|
+
BacklinkDiscoveryInputSchema,
|
|
1922
|
+
BacklinkDiscoveryRunResponseSchema,
|
|
1923
|
+
BacklinkDiscoveryRunSchema,
|
|
1924
|
+
BacklinkNextActionSchema,
|
|
1925
|
+
BacklinkOpportunityTypeSchema,
|
|
1926
|
+
BacklinkOutreachDraftResponseSchema,
|
|
1927
|
+
BacklinkOutreachDraftSchema,
|
|
1928
|
+
BacklinkOutreachUpdateInputSchema,
|
|
1929
|
+
BacklinkProspectListDataSchema,
|
|
1930
|
+
BacklinkProspectListQuerySchema,
|
|
1931
|
+
BacklinkProspectListResponseSchema,
|
|
1932
|
+
BacklinkProspectResponseSchema,
|
|
1933
|
+
BacklinkProspectSchema,
|
|
1934
|
+
BacklinkProspectStageSchema,
|
|
1935
|
+
BacklinkQueueResponseSchema,
|
|
1936
|
+
BacklinkScoreComponentsSchema,
|
|
1937
|
+
BacklinkStageUpdateInputSchema,
|
|
1938
|
+
BacklinkTargetInputSchema,
|
|
1939
|
+
BacklinkTargetListResponseSchema,
|
|
1940
|
+
BacklinkTargetResponseSchema,
|
|
1941
|
+
BacklinkTargetSchema,
|
|
1942
|
+
BacklinkVerificationInputSchema,
|
|
1943
|
+
BacklinkVerificationResponseSchema,
|
|
1944
|
+
BacklinkVerificationSchema,
|
|
1945
|
+
BacklinkVerificationStateSchema,
|
|
1789
1946
|
BlogArticleListSchema,
|
|
1790
1947
|
BlogImageSchema,
|
|
1791
1948
|
BlogMetadataSchema,
|