@odla-ai/brand 0.8.3 → 0.8.5
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 +24 -0
- package/dist/{index-r6SGidYT.d.cts → index-BBjMVilU.d.cts} +1 -0
- package/dist/{index-r6SGidYT.d.ts → index-BBjMVilU.d.ts} +1 -0
- package/dist/index.cjs +593 -148
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +53 -11
- package/dist/index.d.ts +53 -11
- package/dist/index.js +595 -150
- package/dist/index.js.map +1 -1
- package/dist/tokens/index.d.cts +1 -1
- package/dist/tokens/index.d.ts +1 -1
- package/package.json +1 -1
package/dist/index.d.cts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { P as ProposalKind, a as ProposalStatus, A as AssetKind, b as AssetAnalysis, B as BookStatus, c as BrandTokensSnapshot, d as PaletteStatus, S as Swatch, e as PaletteSource, f as SectionKind, g as SectionStatus, h as SwatchRole } from './index-
|
|
2
|
-
export { i as ASSET_KINDS, j as BOOK_STATUSES, k as BRAND_CHART_TOKENS, l as BRAND_CHAT_TOKENS, m as BRAND_DERIVED_TOKENS, n as BRAND_EMITTED_TOKENS, o as BRAND_NS, p as BRAND_REQUIRED_TOKENS, q as BrandTokens, C as CompileInput, r as CompiledBrandTokens, D as DARK_FLIP_L_MAX, s as DARK_FLIP_L_MIN, t as DEFAULT_ACCENT_SEED, u as DESIGN_ASSET_KIND, I as ImagerySection, L as LogoSection, M as MapResult, v as PALETTE_SOURCES, w as PALETTE_STATUSES, x as PROPOSAL_KINDS, y as PROPOSAL_STATUSES, z as PaletteSection, R as ROLE_TOKEN, E as RenderTokensCssOptions, F as SECTION_KINDS, G as SECTION_STATUSES, H as SWATCH_ROLES, T as TokenWarning, J as TypographySection, V as VoiceSection, K as compileBrandTokens, N as deriveDarkTokens, O as mapPaletteToTokens, Q as renderTokensCss } from './index-
|
|
1
|
+
import { P as ProposalKind, a as ProposalStatus, A as AssetKind, b as AssetAnalysis, B as BookStatus, c as BrandTokensSnapshot, d as PaletteStatus, S as Swatch, e as PaletteSource, f as SectionKind, g as SectionStatus, h as SwatchRole } from './index-BBjMVilU.cjs';
|
|
2
|
+
export { i as ASSET_KINDS, j as BOOK_STATUSES, k as BRAND_CHART_TOKENS, l as BRAND_CHAT_TOKENS, m as BRAND_DERIVED_TOKENS, n as BRAND_EMITTED_TOKENS, o as BRAND_NS, p as BRAND_REQUIRED_TOKENS, q as BrandTokens, C as CompileInput, r as CompiledBrandTokens, D as DARK_FLIP_L_MAX, s as DARK_FLIP_L_MIN, t as DEFAULT_ACCENT_SEED, u as DESIGN_ASSET_KIND, I as ImagerySection, L as LogoSection, M as MapResult, v as PALETTE_SOURCES, w as PALETTE_STATUSES, x as PROPOSAL_KINDS, y as PROPOSAL_STATUSES, z as PaletteSection, R as ROLE_TOKEN, E as RenderTokensCssOptions, F as SECTION_KINDS, G as SECTION_STATUSES, H as SWATCH_ROLES, T as TokenWarning, J as TypographySection, V as VoiceSection, K as compileBrandTokens, N as deriveDarkTokens, O as mapPaletteToTokens, Q as renderTokensCss } from './index-BBjMVilU.cjs';
|
|
3
3
|
import { ToolHandler, Skill, ToolDef, Persona, Inference, AgentRunInput, ImageBlock, OracleContentBlock } from '@odla-ai/ai';
|
|
4
4
|
import { PromotionAdapterResult } from '@odla-ai/promotion';
|
|
5
5
|
|
|
@@ -178,9 +178,9 @@ interface BrandHumanAuthorityConsumption {
|
|
|
178
178
|
appId: string;
|
|
179
179
|
/** Exact Registry project lifetime authorized for this Brand decision. */
|
|
180
180
|
appIncarnation: string;
|
|
181
|
-
capability: "brand.proposal.resolve";
|
|
181
|
+
capability: "brand.proposal.resolve" | "brand.book.activate";
|
|
182
182
|
projectCapability: "brand.approve";
|
|
183
|
-
effect: "internal";
|
|
183
|
+
effect: "internal" | "external";
|
|
184
184
|
actionDigest: string;
|
|
185
185
|
resourceDigest: string;
|
|
186
186
|
constraintEvidence: Record<string, unknown>;
|
|
@@ -188,6 +188,40 @@ interface BrandHumanAuthorityConsumption {
|
|
|
188
188
|
requestDigest: string;
|
|
189
189
|
consumedAt: number;
|
|
190
190
|
}
|
|
191
|
+
/** Exact approved revision and promotable payload a human activates. */
|
|
192
|
+
interface BrandBookActivationSnapshot {
|
|
193
|
+
version: 1;
|
|
194
|
+
bookId: string;
|
|
195
|
+
slug: string;
|
|
196
|
+
status: "draft";
|
|
197
|
+
bookVersion: number;
|
|
198
|
+
activationRevision: number;
|
|
199
|
+
activePaletteId: string;
|
|
200
|
+
memberIdsDigest: string;
|
|
201
|
+
tokensSourceDigest: string;
|
|
202
|
+
paletteReceiptId: string;
|
|
203
|
+
paletteActionDigest: string;
|
|
204
|
+
typographyReceiptId: string;
|
|
205
|
+
typographyActionDigest: string;
|
|
206
|
+
approvedSectionKeys: string[];
|
|
207
|
+
promotionDigest: string;
|
|
208
|
+
}
|
|
209
|
+
/** Durable immutable projection of one centrally authorized activation. */
|
|
210
|
+
interface BrandActivationReceipt {
|
|
211
|
+
version: 1;
|
|
212
|
+
id: string;
|
|
213
|
+
mutationKey: string;
|
|
214
|
+
bookId: string;
|
|
215
|
+
reviewedBook: BrandBookActivationSnapshot;
|
|
216
|
+
actionDigest: string;
|
|
217
|
+
approvedBy: string;
|
|
218
|
+
approvedByKind: "human";
|
|
219
|
+
authorityRef: string;
|
|
220
|
+
authorityCapability: "brand.approve";
|
|
221
|
+
authorityConsumption: BrandHumanAuthorityConsumption;
|
|
222
|
+
createdAt: number;
|
|
223
|
+
receiptDigest: string;
|
|
224
|
+
}
|
|
191
225
|
/** Live dependency revision and intended effect consumed by the decision. */
|
|
192
226
|
interface BrandDecisionBinding {
|
|
193
227
|
version: 1;
|
|
@@ -298,6 +332,9 @@ interface BrandBook {
|
|
|
298
332
|
/** CAS counter advanced by every accepted palette activation. */
|
|
299
333
|
activationRevision: number;
|
|
300
334
|
tokens?: BrandTokensSnapshot;
|
|
335
|
+
/** Immutable receipt that activated the current approved revision. */
|
|
336
|
+
activationReceiptId?: string;
|
|
337
|
+
activationActionDigest?: string;
|
|
301
338
|
summary?: string;
|
|
302
339
|
createdAt: number;
|
|
303
340
|
updatedAt: number;
|
|
@@ -534,7 +571,7 @@ interface SerializedSchema {
|
|
|
534
571
|
links: Record<string, SerializedLink>;
|
|
535
572
|
}
|
|
536
573
|
/**
|
|
537
|
-
* The pre-serialized (wire-shape) odla-db schema for the
|
|
574
|
+
* The pre-serialized (wire-shape) odla-db schema for the seven brand
|
|
538
575
|
* namespaces; POST it to `/app/:id/schema` as `{ schema: BRAND_SCHEMA }`.
|
|
539
576
|
* Natural keys (`book.slug`, `section.key`) make provisioning and section
|
|
540
577
|
* upserts idempotent; mirrored `id` attrs make rows addressable by
|
|
@@ -552,7 +589,7 @@ interface BrandRule {
|
|
|
552
589
|
/** Namespace → rule set, as installed at `/app/:id/admin/rules`. */
|
|
553
590
|
type BrandRules = Record<string, BrandRule>;
|
|
554
591
|
/**
|
|
555
|
-
* Default-deny CEL rules for the
|
|
592
|
+
* Default-deny CEL rules for the seven brand namespaces; install at
|
|
556
593
|
* `/app/:id/admin/rules`. Books gate on the `memberIds` roster (owner-only
|
|
557
594
|
* writes); child rows gate reads on current linked-book membership and all
|
|
558
595
|
* writes are worker-mediated. Use
|
|
@@ -660,9 +697,14 @@ declare function rowAsWritten<T>(ns: string, row: T): T;
|
|
|
660
697
|
* mutation-id replays verify the same bytes Brand originally wrote.
|
|
661
698
|
*/
|
|
662
699
|
declare function receiptAsWritten<T>(row: T): T;
|
|
700
|
+
/** A stored activation receipt in the exact shape Brand originally wrote. */
|
|
701
|
+
declare function activationReceiptAsWritten<T>(row: T): T;
|
|
663
702
|
/** A stored proposal in the shape it was written, so `reviewDigest` matches. */
|
|
664
703
|
declare function proposalAsWritten<T>(row: T): T;
|
|
665
704
|
|
|
705
|
+
/** Verify one immutable Brand-book activation projection and all bindings. */
|
|
706
|
+
declare function verifyBrandActivationReceipt(receipt: unknown): Promise<boolean>;
|
|
707
|
+
|
|
666
708
|
/** Stay materially below the server's whole-guards parser budget. */
|
|
667
709
|
declare function isBoundedBrandJson(root: unknown, limits?: {
|
|
668
710
|
maxDepth?: number;
|
|
@@ -1635,12 +1677,12 @@ interface BrandRouteOpts {
|
|
|
1635
1677
|
req: Request;
|
|
1636
1678
|
actor: BrandActor;
|
|
1637
1679
|
appId: string;
|
|
1638
|
-
capability: "brand.proposal.resolve";
|
|
1680
|
+
capability: "brand.proposal.resolve" | "brand.book.activate";
|
|
1639
1681
|
projectCapability: "brand.approve";
|
|
1640
|
-
effect: "internal";
|
|
1682
|
+
effect: "internal" | "external";
|
|
1641
1683
|
resource: {
|
|
1642
1684
|
bookId: string;
|
|
1643
|
-
proposalId
|
|
1685
|
+
proposalId?: string;
|
|
1644
1686
|
};
|
|
1645
1687
|
actionDigest: string;
|
|
1646
1688
|
consumptionIdempotencyKey: string;
|
|
@@ -1918,7 +1960,7 @@ interface BrandPromotionInput {
|
|
|
1918
1960
|
sections: readonly BrandSection[];
|
|
1919
1961
|
palettes: readonly BrandPalette[];
|
|
1920
1962
|
}
|
|
1921
|
-
/** Export only human-approved, provider-independent
|
|
1963
|
+
/** Export only human-approved, receipt-activated, provider-independent state. */
|
|
1922
1964
|
declare function exportBrandPromotion(input: BrandPromotionInput): PromotionAdapterResult;
|
|
1923
1965
|
|
|
1924
|
-
export { ASSET_CONTENT_TYPES, type AcceptProposalInput, AssetAnalysis, AssetKind, type AttrType, type AudienceChildren, BRAND_AGENT_PROFILE, BRAND_DISCUSSION_REFERENCE_KINDS, BRAND_INSTRUCTIONS, BRAND_PROMOTION_ADAPTER, BRAND_RULES, BRAND_SCHEMA, BookStatus, type BrandActor, type BrandAgentBridge, type BrandAgentProfile, type BrandApprovalReceipt, type BrandAsset, type BrandAttrs, type BrandBook, type BrandBotTriggerOpts, type BrandCapabilityAuthority, BrandConflictError, type BrandDb, type BrandDecisionBinding, type BrandDeps, type BrandDiscussionReference, type BrandDiscussionReferenceKind, type BrandDiscussionReferenceTarget, type BrandDiscussionSwatch, type BrandDispatchBody, type BrandDispatchDeps, type BrandEntityRef, type BrandFetchedBytes, type BrandFileRecord, BrandForbiddenError, BrandGoneError, type BrandHumanAuthorityConsumption, BrandInputError, type BrandIntegrationDescriptor, type BrandIntegrationProbe, type BrandLookup, BrandNotFoundError, type BrandOp, type BrandPalette, type BrandPrincipalProjection, type BrandPromotionInput, type BrandProposal, type BrandProposalProvenance, type BrandProposalReviewSnapshot, type BrandResult, BrandReviewStateChangedError, type BrandRouteCtx, type BrandRouteOpts, type BrandRow, type BrandRule, type BrandRules, type BrandScalar, type BrandSection, type BrandSkillOpts, type BrandSkillSelf, type BrandSourceAssetSnapshot, type BrandStorage, BrandTokensSnapshot, type BrandToolCtx, type BrandTransactGuard, type BrandTransactOptions, type BrandTrigger, type BrandUploadBody, type BrandVisionCapabilities, type BrandVisionSpec, CHART_DELTA_MIN, CHAT_MESSAGE_NS, CSS_NAMED_COLORS, type ContrastKind, type CreateAssetInput, type CreateBookInput, type CreateBrandIntegrationOptions, type CreateBrandPersonaOpts, DEFAULT_BRAND_SYSTEM, DESIGN_CONTENT_TYPES, type DeriveChartOptions, type DerivePaletteOptions, type DesignAssetGroup, type DesignBundle, type DesignBundleAsset, type DesignColorUse, type DesignDecompilation, type DesignDigest, type DesignManifestEntry, type DesignOutlineEntry, type DesignProp, type DesignTokenSets, type DesignTokenSkip, type Hsl, type IntegrationProvision, type IntegrationSecret, type IntegrationSetting, type LightnessDirection, MAX_COLORS, MAX_EXTERNALS, MAX_FONTS, MAX_HEADING_CHARS, MAX_OUTLINE_ENTRIES, MAX_PROPS, MAX_SWATCHES, MAX_THUMBNAIL_CHARS, MAX_VIEW_BYTES, type NamedColor, type NearestNamedColor, type Oklab, type Oklch, PICK_TEXT_DEFAULT_CANDIDATES, PaletteSource, PaletteStatus, ProposalKind, ProposalStatus, type ProposePaletteInput, type ProposeSectionInput, RAMP_L_MAX, RAMP_L_MIN, type RejectProposalInput, type ResolvedBrandDeps, type Rgb, type ScannedDeclaration, SectionKind, SectionStatus, type SerializedAttr, type SerializedEntity, type SerializedLink, type SerializedLinkEnd, type SerializedSchema, Swatch, SwatchRole, type UpsertSectionInput, acceptProposalOps, adjustLightnessUntil, analogous, assertAnalysis, assertAssetContentType, assertHex, assertSectionContent, assertSwatches, assetTools, attachedBrandAssetIds, audienceFanoutOps, base64ByteLength, base64FromBytes, beginAssetDeleteOps, bookForChannel, bookTools, brandAuthorityRef, brandBotTrigger, brandDiscussionReferenceHref, brandDiscussionReferenceId, brandInputFor, brandIntegration, brandJsonDigest, brandRules, brandSkill, canonicalBrandJson, capString, capStringArray, clamp01, clampToGamut, collapseWhitespace, complementary, contrastRatio, contrastReport, createAssetOps, createBookOps, createBrandIntegration, createBrandPersona, createBrandRoutes, cssColorToHex, decodeEntities, deltaEOK, deltaEOKLab, deriveChartColors, derivePalette, digestDesignBundle, digestDesignHtml, dispatchBrandTurn, exportBrandPromotion, extractColors, extractDesignTokens, extractFonts, extractOutline, extractProps, extractThumbnailSvg, extractTitle, finishAssetDeleteOps, formatBrandDiscussionReference, groupAssets, hexToOklch, hslToRgb, htmlToText, inSrgbGamut, isBoundedBrandJson, isBrandHumanAuthorityConsumption, isDesignBundle, linearToSrgb, meetsAA, meetsAAA, monochrome, nearestNamedColor, normalizeHex, oklabToOklch, oklabToRgb, oklchToHex, oklchToOklab, paletteTools, parseBrandDiscussionReference, parseBrandDispatch, parseDesignBundle, parseHex, pickTextOn, proposalAsWritten, proposalReviewSnapshot, proposePaletteOps, proposeSectionOps, readDesignManifest, readTools, receiptAsWritten, recordAnalysisOps, rejectProposalOps, relativeLuminance, resolveDeps, resolveVarRefs, rgbToHsl, rgbToOklab, rotateHue, rowAsWritten, safeFileName, scanCustomProperties, sectionKey, splitComplementary, srgbToLinear, stripCssComments, styleSheetText, supportsBrandVision, swatchesFromDesignTokens, tetradic, tintShadeRamp, toHex, triadic, updateBookOps, upsertSectionOps, verifyBrandApprovalReceipt };
|
|
1966
|
+
export { ASSET_CONTENT_TYPES, type AcceptProposalInput, AssetAnalysis, AssetKind, type AttrType, type AudienceChildren, BRAND_AGENT_PROFILE, BRAND_DISCUSSION_REFERENCE_KINDS, BRAND_INSTRUCTIONS, BRAND_PROMOTION_ADAPTER, BRAND_RULES, BRAND_SCHEMA, BookStatus, type BrandActivationReceipt, type BrandActor, type BrandAgentBridge, type BrandAgentProfile, type BrandApprovalReceipt, type BrandAsset, type BrandAttrs, type BrandBook, type BrandBookActivationSnapshot, type BrandBotTriggerOpts, type BrandCapabilityAuthority, BrandConflictError, type BrandDb, type BrandDecisionBinding, type BrandDeps, type BrandDiscussionReference, type BrandDiscussionReferenceKind, type BrandDiscussionReferenceTarget, type BrandDiscussionSwatch, type BrandDispatchBody, type BrandDispatchDeps, type BrandEntityRef, type BrandFetchedBytes, type BrandFileRecord, BrandForbiddenError, BrandGoneError, type BrandHumanAuthorityConsumption, BrandInputError, type BrandIntegrationDescriptor, type BrandIntegrationProbe, type BrandLookup, BrandNotFoundError, type BrandOp, type BrandPalette, type BrandPrincipalProjection, type BrandPromotionInput, type BrandProposal, type BrandProposalProvenance, type BrandProposalReviewSnapshot, type BrandResult, BrandReviewStateChangedError, type BrandRouteCtx, type BrandRouteOpts, type BrandRow, type BrandRule, type BrandRules, type BrandScalar, type BrandSection, type BrandSkillOpts, type BrandSkillSelf, type BrandSourceAssetSnapshot, type BrandStorage, BrandTokensSnapshot, type BrandToolCtx, type BrandTransactGuard, type BrandTransactOptions, type BrandTrigger, type BrandUploadBody, type BrandVisionCapabilities, type BrandVisionSpec, CHART_DELTA_MIN, CHAT_MESSAGE_NS, CSS_NAMED_COLORS, type ContrastKind, type CreateAssetInput, type CreateBookInput, type CreateBrandIntegrationOptions, type CreateBrandPersonaOpts, DEFAULT_BRAND_SYSTEM, DESIGN_CONTENT_TYPES, type DeriveChartOptions, type DerivePaletteOptions, type DesignAssetGroup, type DesignBundle, type DesignBundleAsset, type DesignColorUse, type DesignDecompilation, type DesignDigest, type DesignManifestEntry, type DesignOutlineEntry, type DesignProp, type DesignTokenSets, type DesignTokenSkip, type Hsl, type IntegrationProvision, type IntegrationSecret, type IntegrationSetting, type LightnessDirection, MAX_COLORS, MAX_EXTERNALS, MAX_FONTS, MAX_HEADING_CHARS, MAX_OUTLINE_ENTRIES, MAX_PROPS, MAX_SWATCHES, MAX_THUMBNAIL_CHARS, MAX_VIEW_BYTES, type NamedColor, type NearestNamedColor, type Oklab, type Oklch, PICK_TEXT_DEFAULT_CANDIDATES, PaletteSource, PaletteStatus, ProposalKind, ProposalStatus, type ProposePaletteInput, type ProposeSectionInput, RAMP_L_MAX, RAMP_L_MIN, type RejectProposalInput, type ResolvedBrandDeps, type Rgb, type ScannedDeclaration, SectionKind, SectionStatus, type SerializedAttr, type SerializedEntity, type SerializedLink, type SerializedLinkEnd, type SerializedSchema, Swatch, SwatchRole, type UpsertSectionInput, acceptProposalOps, activationReceiptAsWritten, adjustLightnessUntil, analogous, assertAnalysis, assertAssetContentType, assertHex, assertSectionContent, assertSwatches, assetTools, attachedBrandAssetIds, audienceFanoutOps, base64ByteLength, base64FromBytes, beginAssetDeleteOps, bookForChannel, bookTools, brandAuthorityRef, brandBotTrigger, brandDiscussionReferenceHref, brandDiscussionReferenceId, brandInputFor, brandIntegration, brandJsonDigest, brandRules, brandSkill, canonicalBrandJson, capString, capStringArray, clamp01, clampToGamut, collapseWhitespace, complementary, contrastRatio, contrastReport, createAssetOps, createBookOps, createBrandIntegration, createBrandPersona, createBrandRoutes, cssColorToHex, decodeEntities, deltaEOK, deltaEOKLab, deriveChartColors, derivePalette, digestDesignBundle, digestDesignHtml, dispatchBrandTurn, exportBrandPromotion, extractColors, extractDesignTokens, extractFonts, extractOutline, extractProps, extractThumbnailSvg, extractTitle, finishAssetDeleteOps, formatBrandDiscussionReference, groupAssets, hexToOklch, hslToRgb, htmlToText, inSrgbGamut, isBoundedBrandJson, isBrandHumanAuthorityConsumption, isDesignBundle, linearToSrgb, meetsAA, meetsAAA, monochrome, nearestNamedColor, normalizeHex, oklabToOklch, oklabToRgb, oklchToHex, oklchToOklab, paletteTools, parseBrandDiscussionReference, parseBrandDispatch, parseDesignBundle, parseHex, pickTextOn, proposalAsWritten, proposalReviewSnapshot, proposePaletteOps, proposeSectionOps, readDesignManifest, readTools, receiptAsWritten, recordAnalysisOps, rejectProposalOps, relativeLuminance, resolveDeps, resolveVarRefs, rgbToHsl, rgbToOklab, rotateHue, rowAsWritten, safeFileName, scanCustomProperties, sectionKey, splitComplementary, srgbToLinear, stripCssComments, styleSheetText, supportsBrandVision, swatchesFromDesignTokens, tetradic, tintShadeRamp, toHex, triadic, updateBookOps, upsertSectionOps, verifyBrandActivationReceipt, verifyBrandApprovalReceipt };
|
package/dist/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { P as ProposalKind, a as ProposalStatus, A as AssetKind, b as AssetAnalysis, B as BookStatus, c as BrandTokensSnapshot, d as PaletteStatus, S as Swatch, e as PaletteSource, f as SectionKind, g as SectionStatus, h as SwatchRole } from './index-
|
|
2
|
-
export { i as ASSET_KINDS, j as BOOK_STATUSES, k as BRAND_CHART_TOKENS, l as BRAND_CHAT_TOKENS, m as BRAND_DERIVED_TOKENS, n as BRAND_EMITTED_TOKENS, o as BRAND_NS, p as BRAND_REQUIRED_TOKENS, q as BrandTokens, C as CompileInput, r as CompiledBrandTokens, D as DARK_FLIP_L_MAX, s as DARK_FLIP_L_MIN, t as DEFAULT_ACCENT_SEED, u as DESIGN_ASSET_KIND, I as ImagerySection, L as LogoSection, M as MapResult, v as PALETTE_SOURCES, w as PALETTE_STATUSES, x as PROPOSAL_KINDS, y as PROPOSAL_STATUSES, z as PaletteSection, R as ROLE_TOKEN, E as RenderTokensCssOptions, F as SECTION_KINDS, G as SECTION_STATUSES, H as SWATCH_ROLES, T as TokenWarning, J as TypographySection, V as VoiceSection, K as compileBrandTokens, N as deriveDarkTokens, O as mapPaletteToTokens, Q as renderTokensCss } from './index-
|
|
1
|
+
import { P as ProposalKind, a as ProposalStatus, A as AssetKind, b as AssetAnalysis, B as BookStatus, c as BrandTokensSnapshot, d as PaletteStatus, S as Swatch, e as PaletteSource, f as SectionKind, g as SectionStatus, h as SwatchRole } from './index-BBjMVilU.js';
|
|
2
|
+
export { i as ASSET_KINDS, j as BOOK_STATUSES, k as BRAND_CHART_TOKENS, l as BRAND_CHAT_TOKENS, m as BRAND_DERIVED_TOKENS, n as BRAND_EMITTED_TOKENS, o as BRAND_NS, p as BRAND_REQUIRED_TOKENS, q as BrandTokens, C as CompileInput, r as CompiledBrandTokens, D as DARK_FLIP_L_MAX, s as DARK_FLIP_L_MIN, t as DEFAULT_ACCENT_SEED, u as DESIGN_ASSET_KIND, I as ImagerySection, L as LogoSection, M as MapResult, v as PALETTE_SOURCES, w as PALETTE_STATUSES, x as PROPOSAL_KINDS, y as PROPOSAL_STATUSES, z as PaletteSection, R as ROLE_TOKEN, E as RenderTokensCssOptions, F as SECTION_KINDS, G as SECTION_STATUSES, H as SWATCH_ROLES, T as TokenWarning, J as TypographySection, V as VoiceSection, K as compileBrandTokens, N as deriveDarkTokens, O as mapPaletteToTokens, Q as renderTokensCss } from './index-BBjMVilU.js';
|
|
3
3
|
import { ToolHandler, Skill, ToolDef, Persona, Inference, AgentRunInput, ImageBlock, OracleContentBlock } from '@odla-ai/ai';
|
|
4
4
|
import { PromotionAdapterResult } from '@odla-ai/promotion';
|
|
5
5
|
|
|
@@ -178,9 +178,9 @@ interface BrandHumanAuthorityConsumption {
|
|
|
178
178
|
appId: string;
|
|
179
179
|
/** Exact Registry project lifetime authorized for this Brand decision. */
|
|
180
180
|
appIncarnation: string;
|
|
181
|
-
capability: "brand.proposal.resolve";
|
|
181
|
+
capability: "brand.proposal.resolve" | "brand.book.activate";
|
|
182
182
|
projectCapability: "brand.approve";
|
|
183
|
-
effect: "internal";
|
|
183
|
+
effect: "internal" | "external";
|
|
184
184
|
actionDigest: string;
|
|
185
185
|
resourceDigest: string;
|
|
186
186
|
constraintEvidence: Record<string, unknown>;
|
|
@@ -188,6 +188,40 @@ interface BrandHumanAuthorityConsumption {
|
|
|
188
188
|
requestDigest: string;
|
|
189
189
|
consumedAt: number;
|
|
190
190
|
}
|
|
191
|
+
/** Exact approved revision and promotable payload a human activates. */
|
|
192
|
+
interface BrandBookActivationSnapshot {
|
|
193
|
+
version: 1;
|
|
194
|
+
bookId: string;
|
|
195
|
+
slug: string;
|
|
196
|
+
status: "draft";
|
|
197
|
+
bookVersion: number;
|
|
198
|
+
activationRevision: number;
|
|
199
|
+
activePaletteId: string;
|
|
200
|
+
memberIdsDigest: string;
|
|
201
|
+
tokensSourceDigest: string;
|
|
202
|
+
paletteReceiptId: string;
|
|
203
|
+
paletteActionDigest: string;
|
|
204
|
+
typographyReceiptId: string;
|
|
205
|
+
typographyActionDigest: string;
|
|
206
|
+
approvedSectionKeys: string[];
|
|
207
|
+
promotionDigest: string;
|
|
208
|
+
}
|
|
209
|
+
/** Durable immutable projection of one centrally authorized activation. */
|
|
210
|
+
interface BrandActivationReceipt {
|
|
211
|
+
version: 1;
|
|
212
|
+
id: string;
|
|
213
|
+
mutationKey: string;
|
|
214
|
+
bookId: string;
|
|
215
|
+
reviewedBook: BrandBookActivationSnapshot;
|
|
216
|
+
actionDigest: string;
|
|
217
|
+
approvedBy: string;
|
|
218
|
+
approvedByKind: "human";
|
|
219
|
+
authorityRef: string;
|
|
220
|
+
authorityCapability: "brand.approve";
|
|
221
|
+
authorityConsumption: BrandHumanAuthorityConsumption;
|
|
222
|
+
createdAt: number;
|
|
223
|
+
receiptDigest: string;
|
|
224
|
+
}
|
|
191
225
|
/** Live dependency revision and intended effect consumed by the decision. */
|
|
192
226
|
interface BrandDecisionBinding {
|
|
193
227
|
version: 1;
|
|
@@ -298,6 +332,9 @@ interface BrandBook {
|
|
|
298
332
|
/** CAS counter advanced by every accepted palette activation. */
|
|
299
333
|
activationRevision: number;
|
|
300
334
|
tokens?: BrandTokensSnapshot;
|
|
335
|
+
/** Immutable receipt that activated the current approved revision. */
|
|
336
|
+
activationReceiptId?: string;
|
|
337
|
+
activationActionDigest?: string;
|
|
301
338
|
summary?: string;
|
|
302
339
|
createdAt: number;
|
|
303
340
|
updatedAt: number;
|
|
@@ -534,7 +571,7 @@ interface SerializedSchema {
|
|
|
534
571
|
links: Record<string, SerializedLink>;
|
|
535
572
|
}
|
|
536
573
|
/**
|
|
537
|
-
* The pre-serialized (wire-shape) odla-db schema for the
|
|
574
|
+
* The pre-serialized (wire-shape) odla-db schema for the seven brand
|
|
538
575
|
* namespaces; POST it to `/app/:id/schema` as `{ schema: BRAND_SCHEMA }`.
|
|
539
576
|
* Natural keys (`book.slug`, `section.key`) make provisioning and section
|
|
540
577
|
* upserts idempotent; mirrored `id` attrs make rows addressable by
|
|
@@ -552,7 +589,7 @@ interface BrandRule {
|
|
|
552
589
|
/** Namespace → rule set, as installed at `/app/:id/admin/rules`. */
|
|
553
590
|
type BrandRules = Record<string, BrandRule>;
|
|
554
591
|
/**
|
|
555
|
-
* Default-deny CEL rules for the
|
|
592
|
+
* Default-deny CEL rules for the seven brand namespaces; install at
|
|
556
593
|
* `/app/:id/admin/rules`. Books gate on the `memberIds` roster (owner-only
|
|
557
594
|
* writes); child rows gate reads on current linked-book membership and all
|
|
558
595
|
* writes are worker-mediated. Use
|
|
@@ -660,9 +697,14 @@ declare function rowAsWritten<T>(ns: string, row: T): T;
|
|
|
660
697
|
* mutation-id replays verify the same bytes Brand originally wrote.
|
|
661
698
|
*/
|
|
662
699
|
declare function receiptAsWritten<T>(row: T): T;
|
|
700
|
+
/** A stored activation receipt in the exact shape Brand originally wrote. */
|
|
701
|
+
declare function activationReceiptAsWritten<T>(row: T): T;
|
|
663
702
|
/** A stored proposal in the shape it was written, so `reviewDigest` matches. */
|
|
664
703
|
declare function proposalAsWritten<T>(row: T): T;
|
|
665
704
|
|
|
705
|
+
/** Verify one immutable Brand-book activation projection and all bindings. */
|
|
706
|
+
declare function verifyBrandActivationReceipt(receipt: unknown): Promise<boolean>;
|
|
707
|
+
|
|
666
708
|
/** Stay materially below the server's whole-guards parser budget. */
|
|
667
709
|
declare function isBoundedBrandJson(root: unknown, limits?: {
|
|
668
710
|
maxDepth?: number;
|
|
@@ -1635,12 +1677,12 @@ interface BrandRouteOpts {
|
|
|
1635
1677
|
req: Request;
|
|
1636
1678
|
actor: BrandActor;
|
|
1637
1679
|
appId: string;
|
|
1638
|
-
capability: "brand.proposal.resolve";
|
|
1680
|
+
capability: "brand.proposal.resolve" | "brand.book.activate";
|
|
1639
1681
|
projectCapability: "brand.approve";
|
|
1640
|
-
effect: "internal";
|
|
1682
|
+
effect: "internal" | "external";
|
|
1641
1683
|
resource: {
|
|
1642
1684
|
bookId: string;
|
|
1643
|
-
proposalId
|
|
1685
|
+
proposalId?: string;
|
|
1644
1686
|
};
|
|
1645
1687
|
actionDigest: string;
|
|
1646
1688
|
consumptionIdempotencyKey: string;
|
|
@@ -1918,7 +1960,7 @@ interface BrandPromotionInput {
|
|
|
1918
1960
|
sections: readonly BrandSection[];
|
|
1919
1961
|
palettes: readonly BrandPalette[];
|
|
1920
1962
|
}
|
|
1921
|
-
/** Export only human-approved, provider-independent
|
|
1963
|
+
/** Export only human-approved, receipt-activated, provider-independent state. */
|
|
1922
1964
|
declare function exportBrandPromotion(input: BrandPromotionInput): PromotionAdapterResult;
|
|
1923
1965
|
|
|
1924
|
-
export { ASSET_CONTENT_TYPES, type AcceptProposalInput, AssetAnalysis, AssetKind, type AttrType, type AudienceChildren, BRAND_AGENT_PROFILE, BRAND_DISCUSSION_REFERENCE_KINDS, BRAND_INSTRUCTIONS, BRAND_PROMOTION_ADAPTER, BRAND_RULES, BRAND_SCHEMA, BookStatus, type BrandActor, type BrandAgentBridge, type BrandAgentProfile, type BrandApprovalReceipt, type BrandAsset, type BrandAttrs, type BrandBook, type BrandBotTriggerOpts, type BrandCapabilityAuthority, BrandConflictError, type BrandDb, type BrandDecisionBinding, type BrandDeps, type BrandDiscussionReference, type BrandDiscussionReferenceKind, type BrandDiscussionReferenceTarget, type BrandDiscussionSwatch, type BrandDispatchBody, type BrandDispatchDeps, type BrandEntityRef, type BrandFetchedBytes, type BrandFileRecord, BrandForbiddenError, BrandGoneError, type BrandHumanAuthorityConsumption, BrandInputError, type BrandIntegrationDescriptor, type BrandIntegrationProbe, type BrandLookup, BrandNotFoundError, type BrandOp, type BrandPalette, type BrandPrincipalProjection, type BrandPromotionInput, type BrandProposal, type BrandProposalProvenance, type BrandProposalReviewSnapshot, type BrandResult, BrandReviewStateChangedError, type BrandRouteCtx, type BrandRouteOpts, type BrandRow, type BrandRule, type BrandRules, type BrandScalar, type BrandSection, type BrandSkillOpts, type BrandSkillSelf, type BrandSourceAssetSnapshot, type BrandStorage, BrandTokensSnapshot, type BrandToolCtx, type BrandTransactGuard, type BrandTransactOptions, type BrandTrigger, type BrandUploadBody, type BrandVisionCapabilities, type BrandVisionSpec, CHART_DELTA_MIN, CHAT_MESSAGE_NS, CSS_NAMED_COLORS, type ContrastKind, type CreateAssetInput, type CreateBookInput, type CreateBrandIntegrationOptions, type CreateBrandPersonaOpts, DEFAULT_BRAND_SYSTEM, DESIGN_CONTENT_TYPES, type DeriveChartOptions, type DerivePaletteOptions, type DesignAssetGroup, type DesignBundle, type DesignBundleAsset, type DesignColorUse, type DesignDecompilation, type DesignDigest, type DesignManifestEntry, type DesignOutlineEntry, type DesignProp, type DesignTokenSets, type DesignTokenSkip, type Hsl, type IntegrationProvision, type IntegrationSecret, type IntegrationSetting, type LightnessDirection, MAX_COLORS, MAX_EXTERNALS, MAX_FONTS, MAX_HEADING_CHARS, MAX_OUTLINE_ENTRIES, MAX_PROPS, MAX_SWATCHES, MAX_THUMBNAIL_CHARS, MAX_VIEW_BYTES, type NamedColor, type NearestNamedColor, type Oklab, type Oklch, PICK_TEXT_DEFAULT_CANDIDATES, PaletteSource, PaletteStatus, ProposalKind, ProposalStatus, type ProposePaletteInput, type ProposeSectionInput, RAMP_L_MAX, RAMP_L_MIN, type RejectProposalInput, type ResolvedBrandDeps, type Rgb, type ScannedDeclaration, SectionKind, SectionStatus, type SerializedAttr, type SerializedEntity, type SerializedLink, type SerializedLinkEnd, type SerializedSchema, Swatch, SwatchRole, type UpsertSectionInput, acceptProposalOps, adjustLightnessUntil, analogous, assertAnalysis, assertAssetContentType, assertHex, assertSectionContent, assertSwatches, assetTools, attachedBrandAssetIds, audienceFanoutOps, base64ByteLength, base64FromBytes, beginAssetDeleteOps, bookForChannel, bookTools, brandAuthorityRef, brandBotTrigger, brandDiscussionReferenceHref, brandDiscussionReferenceId, brandInputFor, brandIntegration, brandJsonDigest, brandRules, brandSkill, canonicalBrandJson, capString, capStringArray, clamp01, clampToGamut, collapseWhitespace, complementary, contrastRatio, contrastReport, createAssetOps, createBookOps, createBrandIntegration, createBrandPersona, createBrandRoutes, cssColorToHex, decodeEntities, deltaEOK, deltaEOKLab, deriveChartColors, derivePalette, digestDesignBundle, digestDesignHtml, dispatchBrandTurn, exportBrandPromotion, extractColors, extractDesignTokens, extractFonts, extractOutline, extractProps, extractThumbnailSvg, extractTitle, finishAssetDeleteOps, formatBrandDiscussionReference, groupAssets, hexToOklch, hslToRgb, htmlToText, inSrgbGamut, isBoundedBrandJson, isBrandHumanAuthorityConsumption, isDesignBundle, linearToSrgb, meetsAA, meetsAAA, monochrome, nearestNamedColor, normalizeHex, oklabToOklch, oklabToRgb, oklchToHex, oklchToOklab, paletteTools, parseBrandDiscussionReference, parseBrandDispatch, parseDesignBundle, parseHex, pickTextOn, proposalAsWritten, proposalReviewSnapshot, proposePaletteOps, proposeSectionOps, readDesignManifest, readTools, receiptAsWritten, recordAnalysisOps, rejectProposalOps, relativeLuminance, resolveDeps, resolveVarRefs, rgbToHsl, rgbToOklab, rotateHue, rowAsWritten, safeFileName, scanCustomProperties, sectionKey, splitComplementary, srgbToLinear, stripCssComments, styleSheetText, supportsBrandVision, swatchesFromDesignTokens, tetradic, tintShadeRamp, toHex, triadic, updateBookOps, upsertSectionOps, verifyBrandApprovalReceipt };
|
|
1966
|
+
export { ASSET_CONTENT_TYPES, type AcceptProposalInput, AssetAnalysis, AssetKind, type AttrType, type AudienceChildren, BRAND_AGENT_PROFILE, BRAND_DISCUSSION_REFERENCE_KINDS, BRAND_INSTRUCTIONS, BRAND_PROMOTION_ADAPTER, BRAND_RULES, BRAND_SCHEMA, BookStatus, type BrandActivationReceipt, type BrandActor, type BrandAgentBridge, type BrandAgentProfile, type BrandApprovalReceipt, type BrandAsset, type BrandAttrs, type BrandBook, type BrandBookActivationSnapshot, type BrandBotTriggerOpts, type BrandCapabilityAuthority, BrandConflictError, type BrandDb, type BrandDecisionBinding, type BrandDeps, type BrandDiscussionReference, type BrandDiscussionReferenceKind, type BrandDiscussionReferenceTarget, type BrandDiscussionSwatch, type BrandDispatchBody, type BrandDispatchDeps, type BrandEntityRef, type BrandFetchedBytes, type BrandFileRecord, BrandForbiddenError, BrandGoneError, type BrandHumanAuthorityConsumption, BrandInputError, type BrandIntegrationDescriptor, type BrandIntegrationProbe, type BrandLookup, BrandNotFoundError, type BrandOp, type BrandPalette, type BrandPrincipalProjection, type BrandPromotionInput, type BrandProposal, type BrandProposalProvenance, type BrandProposalReviewSnapshot, type BrandResult, BrandReviewStateChangedError, type BrandRouteCtx, type BrandRouteOpts, type BrandRow, type BrandRule, type BrandRules, type BrandScalar, type BrandSection, type BrandSkillOpts, type BrandSkillSelf, type BrandSourceAssetSnapshot, type BrandStorage, BrandTokensSnapshot, type BrandToolCtx, type BrandTransactGuard, type BrandTransactOptions, type BrandTrigger, type BrandUploadBody, type BrandVisionCapabilities, type BrandVisionSpec, CHART_DELTA_MIN, CHAT_MESSAGE_NS, CSS_NAMED_COLORS, type ContrastKind, type CreateAssetInput, type CreateBookInput, type CreateBrandIntegrationOptions, type CreateBrandPersonaOpts, DEFAULT_BRAND_SYSTEM, DESIGN_CONTENT_TYPES, type DeriveChartOptions, type DerivePaletteOptions, type DesignAssetGroup, type DesignBundle, type DesignBundleAsset, type DesignColorUse, type DesignDecompilation, type DesignDigest, type DesignManifestEntry, type DesignOutlineEntry, type DesignProp, type DesignTokenSets, type DesignTokenSkip, type Hsl, type IntegrationProvision, type IntegrationSecret, type IntegrationSetting, type LightnessDirection, MAX_COLORS, MAX_EXTERNALS, MAX_FONTS, MAX_HEADING_CHARS, MAX_OUTLINE_ENTRIES, MAX_PROPS, MAX_SWATCHES, MAX_THUMBNAIL_CHARS, MAX_VIEW_BYTES, type NamedColor, type NearestNamedColor, type Oklab, type Oklch, PICK_TEXT_DEFAULT_CANDIDATES, PaletteSource, PaletteStatus, ProposalKind, ProposalStatus, type ProposePaletteInput, type ProposeSectionInput, RAMP_L_MAX, RAMP_L_MIN, type RejectProposalInput, type ResolvedBrandDeps, type Rgb, type ScannedDeclaration, SectionKind, SectionStatus, type SerializedAttr, type SerializedEntity, type SerializedLink, type SerializedLinkEnd, type SerializedSchema, Swatch, SwatchRole, type UpsertSectionInput, acceptProposalOps, activationReceiptAsWritten, adjustLightnessUntil, analogous, assertAnalysis, assertAssetContentType, assertHex, assertSectionContent, assertSwatches, assetTools, attachedBrandAssetIds, audienceFanoutOps, base64ByteLength, base64FromBytes, beginAssetDeleteOps, bookForChannel, bookTools, brandAuthorityRef, brandBotTrigger, brandDiscussionReferenceHref, brandDiscussionReferenceId, brandInputFor, brandIntegration, brandJsonDigest, brandRules, brandSkill, canonicalBrandJson, capString, capStringArray, clamp01, clampToGamut, collapseWhitespace, complementary, contrastRatio, contrastReport, createAssetOps, createBookOps, createBrandIntegration, createBrandPersona, createBrandRoutes, cssColorToHex, decodeEntities, deltaEOK, deltaEOKLab, deriveChartColors, derivePalette, digestDesignBundle, digestDesignHtml, dispatchBrandTurn, exportBrandPromotion, extractColors, extractDesignTokens, extractFonts, extractOutline, extractProps, extractThumbnailSvg, extractTitle, finishAssetDeleteOps, formatBrandDiscussionReference, groupAssets, hexToOklch, hslToRgb, htmlToText, inSrgbGamut, isBoundedBrandJson, isBrandHumanAuthorityConsumption, isDesignBundle, linearToSrgb, meetsAA, meetsAAA, monochrome, nearestNamedColor, normalizeHex, oklabToOklch, oklabToRgb, oklchToHex, oklchToOklab, paletteTools, parseBrandDiscussionReference, parseBrandDispatch, parseDesignBundle, parseHex, pickTextOn, proposalAsWritten, proposalReviewSnapshot, proposePaletteOps, proposeSectionOps, readDesignManifest, readTools, receiptAsWritten, recordAnalysisOps, rejectProposalOps, relativeLuminance, resolveDeps, resolveVarRefs, rgbToHsl, rgbToOklab, rotateHue, rowAsWritten, safeFileName, scanCustomProperties, sectionKey, splitComplementary, srgbToLinear, stripCssComments, styleSheetText, supportsBrandVision, swatchesFromDesignTokens, tetradic, tintShadeRamp, toHex, triadic, updateBookOps, upsertSectionOps, verifyBrandActivationReceipt, verifyBrandApprovalReceipt };
|