@histoire/protocol 0.0.0-stage → 1.0.0-beta.3

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.
Files changed (114) hide show
  1. package/LICENSE +21 -0
  2. package/dist/bridge/catalog.d.ts +12 -0
  3. package/dist/bridge/catalog.d.ts.map +1 -0
  4. package/dist/bridge/envelope.d.ts +18 -0
  5. package/dist/bridge/envelope.d.ts.map +1 -0
  6. package/dist/bridge/events.d.ts +9 -0
  7. package/dist/bridge/events.d.ts.map +1 -0
  8. package/dist/bridge/handshake.d.ts +42 -0
  9. package/dist/bridge/handshake.d.ts.map +1 -0
  10. package/dist/bridge/limits.d.ts +41 -0
  11. package/dist/bridge/limits.d.ts.map +1 -0
  12. package/dist/bridge/payload.d.ts +9 -0
  13. package/dist/bridge/payload.d.ts.map +1 -0
  14. package/dist/bridge/project-test-collection.d.ts +5 -0
  15. package/dist/bridge/project-test-collection.d.ts.map +1 -0
  16. package/dist/bridge/results.d.ts +12 -0
  17. package/dist/bridge/results.d.ts.map +1 -0
  18. package/dist/bridge/size.d.ts +23 -0
  19. package/dist/bridge/size.d.ts.map +1 -0
  20. package/dist/bridge/snapshot.d.ts +27 -0
  21. package/dist/bridge/snapshot.d.ts.map +1 -0
  22. package/dist/bridge/source-descriptor.d.ts +5 -0
  23. package/dist/bridge/source-descriptor.d.ts.map +1 -0
  24. package/dist/bridge/string-size.d.ts +12 -0
  25. package/dist/bridge/string-size.d.ts.map +1 -0
  26. package/dist/bridge/test-execution.d.ts +4 -0
  27. package/dist/bridge/test-execution.d.ts.map +1 -0
  28. package/dist/bridge/types.d.ts +83 -0
  29. package/dist/bridge/types.d.ts.map +1 -0
  30. package/dist/bridge/validation.d.ts +14 -0
  31. package/dist/bridge/validation.d.ts.map +1 -0
  32. package/dist/channels.d.ts +42 -0
  33. package/dist/channels.d.ts.map +1 -0
  34. package/dist/geometry.d.ts +9 -0
  35. package/dist/geometry.d.ts.map +1 -0
  36. package/dist/helpers/matrix-numeric.d.ts +18 -0
  37. package/dist/helpers/matrix-numeric.d.ts.map +1 -0
  38. package/dist/helpers/matrix.d.ts +22 -0
  39. package/dist/helpers/matrix.d.ts.map +1 -0
  40. package/dist/helpers/meta.d.ts +26 -0
  41. package/dist/helpers/meta.d.ts.map +1 -0
  42. package/dist/helpers/story-frame.d.ts +4 -0
  43. package/dist/helpers/story-frame.d.ts.map +1 -0
  44. package/dist/helpers/story-route.d.ts +25 -0
  45. package/dist/helpers/story-route.d.ts.map +1 -0
  46. package/dist/index.d.ts +51 -0
  47. package/dist/index.d.ts.map +1 -0
  48. package/dist/index.js +3295 -0
  49. package/dist/inspection/capabilities.d.ts +24 -0
  50. package/dist/inspection/capabilities.d.ts.map +1 -0
  51. package/dist/inspection/debug-buffer.d.ts +21 -0
  52. package/dist/inspection/debug-buffer.d.ts.map +1 -0
  53. package/dist/inspection/extensions.d.ts +5 -0
  54. package/dist/inspection/extensions.d.ts.map +1 -0
  55. package/dist/inspection/rows.d.ts +5 -0
  56. package/dist/inspection/rows.d.ts.map +1 -0
  57. package/dist/inspection/validation.d.ts +23 -0
  58. package/dist/inspection/validation.d.ts.map +1 -0
  59. package/dist/plugin-channels.d.ts +84 -0
  60. package/dist/plugin-channels.d.ts.map +1 -0
  61. package/dist/serialization/controls-revision.d.ts +12 -0
  62. package/dist/serialization/controls-revision.d.ts.map +1 -0
  63. package/dist/serialization/state.d.ts +12 -0
  64. package/dist/serialization/state.d.ts.map +1 -0
  65. package/dist/serialization/test-errors.d.ts +8 -0
  66. package/dist/serialization/test-errors.d.ts.map +1 -0
  67. package/dist/theme/color.d.ts +17 -0
  68. package/dist/theme/color.d.ts.map +1 -0
  69. package/dist/theme/semantic.d.ts +32 -0
  70. package/dist/theme/semantic.d.ts.map +1 -0
  71. package/dist/types/catalog.d.ts +172 -0
  72. package/dist/types/catalog.d.ts.map +1 -0
  73. package/dist/types/common.d.ts +59 -0
  74. package/dist/types/common.d.ts.map +1 -0
  75. package/dist/types/content.d.ts +34 -0
  76. package/dist/types/content.d.ts.map +1 -0
  77. package/dist/types/controls.d.ts +132 -0
  78. package/dist/types/controls.d.ts.map +1 -0
  79. package/dist/types/debug.d.ts +64 -0
  80. package/dist/types/debug.d.ts.map +1 -0
  81. package/dist/types/embed-presentation.d.ts +25 -0
  82. package/dist/types/embed-presentation.d.ts.map +1 -0
  83. package/dist/types/error.d.ts +23 -0
  84. package/dist/types/error.d.ts.map +1 -0
  85. package/dist/types/inspection-accessibility.d.ts +43 -0
  86. package/dist/types/inspection-accessibility.d.ts.map +1 -0
  87. package/dist/types/inspection-components.d.ts +69 -0
  88. package/dist/types/inspection-components.d.ts.map +1 -0
  89. package/dist/types/inspection.d.ts +221 -0
  90. package/dist/types/inspection.d.ts.map +1 -0
  91. package/dist/types/isolated-inspection.d.ts +69 -0
  92. package/dist/types/isolated-inspection.d.ts.map +1 -0
  93. package/dist/types/preview-message.d.ts +179 -0
  94. package/dist/types/preview-message.d.ts.map +1 -0
  95. package/dist/types/readonly.d.ts +5 -0
  96. package/dist/types/readonly.d.ts.map +1 -0
  97. package/dist/types/settings.d.ts +31 -0
  98. package/dist/types/settings.d.ts.map +1 -0
  99. package/dist/types/snapshot.d.ts +94 -0
  100. package/dist/types/snapshot.d.ts.map +1 -0
  101. package/dist/types/source-descriptor.d.ts +72 -0
  102. package/dist/types/source-descriptor.d.ts.map +1 -0
  103. package/dist/types/source-search.d.ts +20 -0
  104. package/dist/types/source-search.d.ts.map +1 -0
  105. package/dist/types/test.d.ts +208 -0
  106. package/dist/types/test.d.ts.map +1 -0
  107. package/dist/url/embed-origins.d.ts +16 -0
  108. package/dist/url/embed-origins.d.ts.map +1 -0
  109. package/dist/url/embed.d.ts +30 -0
  110. package/dist/url/embed.d.ts.map +1 -0
  111. package/dist/url/preview.d.ts +14 -0
  112. package/dist/url/preview.d.ts.map +1 -0
  113. package/package.json +32 -3
  114. package/README.md +0 -3
@@ -0,0 +1,24 @@
1
+ import type { HistoireInspectionCapabilities } from '../types/inspection.js';
2
+ /** Source extension names remain separate from strict legacy capabilities. */
3
+ export declare const HISTOIRE_INSPECTION_CAPABILITIES: readonly ['variant', 'dom', 'components', 'componentDetails', 'accessibilityAudit', 'highlight', 'componentHighlight', 'pick', 'highlightLease', 'diagnostics'];
4
+ /** Explicit operation-to-capability mapping; names need not be interchangeable. */
5
+ export declare const HISTOIRE_INSPECTION_OPERATION_CAPABILITIES: {
6
+ readonly variant: 'variant';
7
+ readonly dom: 'dom';
8
+ readonly components: 'components';
9
+ readonly component: 'componentDetails';
10
+ readonly componentForElement: 'componentDetails';
11
+ readonly accessibility: 'accessibilityAudit';
12
+ readonly highlight: 'highlight';
13
+ readonly pick: 'pick';
14
+ readonly highlightLease: 'highlightLease';
15
+ readonly highlightClear: 'highlightLease';
16
+ readonly debug: 'diagnostics';
17
+ };
18
+ /** Validate every optional capability before projecting it to callers. */
19
+ export declare function validateInspectionCapabilities(value: unknown): HistoireInspectionCapabilities;
20
+ /** Absence and explicit false always deny; descriptors are only upper bounds. */
21
+ export declare function hasInspectionCapability(value: HistoireInspectionCapabilities | undefined, key: keyof HistoireInspectionCapabilities): boolean;
22
+ /** Validate source-owned exact-origin policy, independently of legacy embed keys. */
23
+ export declare function validateInspectionPolicy(value: unknown): void;
24
+ //# sourceMappingURL=capabilities.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"capabilities.d.ts","sourceRoot":"","sources":["../../src/inspection/capabilities.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,8BAA8B,EAAE,MAAM,wBAAwB,CAAA;AAK5E,8EAA8E;AAC9E,eAAO,MAAM,gCAAgC,YAAI,SAAS,EAAE,KAAK,EAAE,YAAY,EAAE,kBAAkB,EAAE,oBAAoB,EAAE,WAAW,EAAE,oBAAoB,EAAE,MAAM,EAAE,gBAAgB,EAAE,aAAa,CAAU,CAAA;AAC/M,mFAAmF;AACnF,eAAO,MAAM,0CAA0C;aACrD,OAAO,EAAE,SAAS;aAClB,GAAG,EAAE,KAAK;aACV,UAAU,EAAE,YAAY;aACxB,SAAS,EAAE,kBAAkB;aAC7B,mBAAmB,EAAE,kBAAkB;aACvC,aAAa,EAAE,oBAAoB;aACnC,SAAS,EAAE,WAAW;aACtB,IAAI,EAAE,MAAM;aACZ,cAAc,EAAE,gBAAgB;aAChC,cAAc,EAAE,gBAAgB;aAChC,KAAK,EAAE,aAAa;CACZ,CAAA;AACV,0EAA0E;AAC1E,wBAAgB,8BAA8B,CAAC,KAAK,EAAE,OAAO,GAAG,8BAA8B,CAS7F;AACD,iFAAiF;AACjF,wBAAgB,uBAAuB,CAAC,KAAK,EAAE,8BAA8B,GAAG,SAAS,EAAE,GAAG,EAAE,MAAM,8BAA8B,GAAG,OAAO,CAE7I;AACD,qFAAqF;AACrF,wBAAgB,wBAAwB,CAAC,KAAK,EAAE,OAAO,GAAG,IAAI,CAK7D"}
@@ -0,0 +1,21 @@
1
+ import type { HistoireDebugEntry, HistoireDebugPage } from '../types/debug.js';
2
+ /** Bounded detached timeline; sequence numbers also account for omitted entries. */
3
+ export declare function createDebugBuffer(options?: {
4
+ maxEntries?: number;
5
+ maxBytes?: number;
6
+ }): {
7
+ /** Latest allocated sequence including dropped observations. */
8
+ cursor(): number;
9
+ /** Add only detached complete entries within the per-entry bound. */
10
+ add(value: Omit<HistoireDebugEntry, 'sequence'>): void;
11
+ /** Count observations omitted before retention and reserve their sequence numbers. */
12
+ drop(count?: number): void;
13
+ /** Return a complete bounded page with loss and continuation metadata. */
14
+ read(input?: {
15
+ afterSequence?: number;
16
+ limit?: number;
17
+ }): HistoireDebugPage;
18
+ /** Discard retained rows without recycling identities or hiding their loss. */
19
+ clear(): void;
20
+ };
21
+ //# sourceMappingURL=debug-buffer.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"debug-buffer.d.ts","sourceRoot":"","sources":["../../src/inspection/debug-buffer.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,kBAAkB,EAAE,iBAAiB,EAAE,MAAM,mBAAmB,CAAA;AAE9E,oFAAoF;AACpF,wBAAgB,iBAAiB,CAAC,OAAO,GAAE;IAAE,UAAU,CAAC,EAAE,MAAM,CAAC;IAAC,QAAQ,CAAC,EAAE,MAAM,CAAA;CAAO;IAatF,gEAAgE;IAChE,MAAM,IAAI,MAAM;IAChB,qEAAqE;IACrE,GAAG,QAAQ,IAAI,CAAC,kBAAkB,EAAE,UAAU,CAAC,GAAG,IAAI;IAetD,sFAAsF;IACtF,IAAI,kBAAa,IAAI;IAKrB,0EAA0E;IAC1E,IAAI,SAAQ;QAAE,aAAa,CAAC,EAAE,MAAM,CAAC;QAAC,KAAK,CAAC,EAAE,MAAM,CAAA;KAAE,GAAQ,iBAAiB;IAyB/E,+EAA+E;IAC/E,KAAK,IAAI,IAAI;EAMhB"}
@@ -0,0 +1,5 @@
1
+ /** Validate framework tree or selected instance details after common JSON budget. */
2
+ export declare function validateComponentExtension(input: Record<string, unknown>, base: string[]): void;
3
+ /** Bounded findings omit raw HTML and executable axe configuration. */
4
+ export declare function validateAccessibilityExtension(input: Record<string, unknown>, base: string[]): void;
5
+ //# sourceMappingURL=extensions.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"extensions.d.ts","sourceRoot":"","sources":["../../src/inspection/extensions.ts"],"names":[],"mappings":"AA+BA,qFAAqF;AACrF,wBAAgB,0BAA0B,CAAC,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,GAAG,IAAI,CAgC/F;AACD,uEAAuE;AACvE,wBAAgB,8BAA8B,CAAC,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,GAAG,IAAI,CA4BnG"}
@@ -0,0 +1,5 @@
1
+ /** Validate component prop metadata after shared JSON graph validation. */
2
+ export declare function validateInspectionComponents(value: unknown): void;
3
+ /** Validate preorder geometry and parents, rejecting impossible snapshot references. */
4
+ export declare function validateInspectionNodes(value: unknown): void;
5
+ //# sourceMappingURL=rows.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"rows.d.ts","sourceRoot":"","sources":["../../src/inspection/rows.ts"],"names":[],"mappings":"AAUA,2EAA2E;AAC3E,wBAAgB,4BAA4B,CAAC,KAAK,EAAE,OAAO,GAAG,IAAI,CAmBjE;AACD,wFAAwF;AACxF,wBAAgB,uBAAuB,CAAC,KAAK,EAAE,OAAO,GAAG,IAAI,CAiB5D"}
@@ -0,0 +1,23 @@
1
+ import type { HistoireInspectionOwner, HistoireInspectionResult } from '../types/inspection.js';
2
+ /** Shared response budget leaves room for transport metadata. */
3
+ export declare const HISTOIRE_INSPECTION_LIMITS: {
4
+ readonly result: number;
5
+ readonly nodes: 500;
6
+ readonly depth: 20;
7
+ readonly selector: 512;
8
+ readonly pending: 4;
9
+ readonly timeout: 5000;
10
+ };
11
+ /** An inspection target always names a rendered variant. */
12
+ export declare function validateInspectionTarget(value: unknown): HistoireInspectionOwner['target'];
13
+ /** Validate the entire tuple; caller-provided IDs never grant access. */
14
+ export declare function validateInspectionOwner(value: unknown): HistoireInspectionOwner;
15
+ /** Compare structured IDs without ambiguous string concatenation. */
16
+ export declare function sameInspectionOwner(a: HistoireInspectionOwner, b: HistoireInspectionOwner): boolean;
17
+ /** Validate finite wire inputs. AbortSignal is intentionally absent. */
18
+ export declare function validateInspectionInput(kind: string, value: unknown): Record<string, unknown>;
19
+ /** Strict JSON validation avoids coercing callbacks, unsupported values or accessors. */
20
+ export declare function assertInspectionJson(value: unknown, ancestors?: Set<object>): void;
21
+ /** Validate detached read result before exposing it outside the owning runtime. */
22
+ export declare function validateInspectionResult(value: unknown): HistoireInspectionResult;
23
+ //# sourceMappingURL=validation.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"validation.d.ts","sourceRoot":"","sources":["../../src/inspection/validation.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,uBAAuB,EAAE,wBAAwB,EAAE,MAAM,wBAAwB,CAAA;AAO/F,iEAAiE;AACjE,eAAO,MAAM,0BAA0B;aAAK,MAAM;aAAa,KAAK,EAAE,GAAG;aAAE,KAAK,EAAE,EAAE;aAAE,QAAQ,EAAE,GAAG;aAAE,OAAO,EAAE,CAAC;aAAE,OAAO,EAAE,IAAI;CAAW,CAAA;AAKzI,4DAA4D;AAC5D,wBAAgB,wBAAwB,CAAC,KAAK,EAAE,OAAO,GAAG,uBAAuB,CAAC,QAAQ,CAAC,CAM1F;AACD,yEAAyE;AACzE,wBAAgB,uBAAuB,CAAC,KAAK,EAAE,OAAO,GAAG,uBAAuB,CAS/E;AACD,qEAAqE;AACrE,wBAAgB,mBAAmB,CAAC,CAAC,EAAE,uBAAuB,EAAE,CAAC,EAAE,uBAAuB,GAAG,OAAO,CAGnG;AACD,wEAAwE;AACxE,wBAAgB,uBAAuB,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,OAAO,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAuB7F;AACD,yFAAyF;AACzF,wBAAgB,oBAAoB,CAAC,KAAK,EAAE,OAAO,EAAE,SAAS,cAAoB,GAAG,IAAI,CAYxF;AACD,mFAAmF;AACnF,wBAAgB,wBAAwB,CAAC,KAAK,EAAE,OAAO,GAAG,wBAAwB,CA+CjF"}
@@ -0,0 +1,84 @@
1
+ import type { HistoireJsonValue, HistoireTarget } from './types/common.js';
2
+ import { createHostChannelRateLimiter } from './channels.js';
3
+ /** Byte budget of one plugin message, same as named host channels. */
4
+ export declare const HISTOIRE_PLUGIN_CHANNEL_MAX_BYTES: number;
5
+ /** Plugin id grammar shared with `@histoire/plugin-kit` descriptors; `builtin` is reserved. */
6
+ export declare const HISTOIRE_PLUGIN_ID_PATTERN: RegExp;
7
+ /** Message types under this prefix are runtime notices; plugins can neither send nor observe them. */
8
+ export declare const HISTOIRE_PLUGIN_NOTICE_PREFIX = "histoire:";
9
+ /** Frame runtime notices: actor attached after `attach` settled, actor detached, plugin failure. */
10
+ export declare const HISTOIRE_PLUGIN_NOTICES: readonly ['histoire:attached', 'histoire:detached', 'histoire:error'];
11
+ /** One runtime notice type. */
12
+ export type HistoirePluginNotice = typeof HISTOIRE_PLUGIN_NOTICES[number];
13
+ /** Wire body of one plugin message; never carries a host channel name. */
14
+ export interface HistoirePluginChannelPayload {
15
+ /** Plugin owning both ends of the channel. */
16
+ pluginId: string;
17
+ /** Exact frame actor the message comes from or goes to. */
18
+ actorId: string;
19
+ /** Plugin-chosen message discriminator. */
20
+ type: string;
21
+ /** Bounded JSON. */
22
+ data: HistoireJsonValue;
23
+ }
24
+ /** Message as listeners receive it, attributed to the actor's rendered variant. */
25
+ export interface HistoirePluginChannelMessage extends HistoirePluginChannelPayload {
26
+ /** Variant rendered by the actor. */
27
+ target: HistoireTarget;
28
+ }
29
+ /** `plugin.message` publication: message plus the runtime document hosting the actor. */
30
+ export interface HistoirePluginChannelEvent extends HistoirePluginChannelMessage {
31
+ /** Runtime document identity. */
32
+ runtimeId: string;
33
+ }
34
+ /** Per-plugin channel bound to exactly one frame actor (structurally equal to plugin-kit `PluginChannel`). */
35
+ export interface HistoirePluginChannel {
36
+ /** Sends one message to the bound actor; rejects once the actor retired. */
37
+ post: (type: string, data: HistoireJsonValue) => Promise<void>;
38
+ /** Observes messages of one type from the bound actor; returns unsubscribe. */
39
+ on: (type: string, listener: (data: HistoireJsonValue, message: HistoirePluginChannelMessage) => void) => () => void;
40
+ /** Messages of this plugin dropped by validation, rate or listener failure. */
41
+ getDroppedCount: () => number;
42
+ }
43
+ /** Installed frame plugin as advertised by a source descriptor; data only. */
44
+ export interface HistoireFramePluginInfo {
45
+ /** Plugin id. */
46
+ id: string;
47
+ /** Frame contract version. */
48
+ apiVersion: number;
49
+ }
50
+ /** Whether `type` names a runtime notice rather than plugin data. */
51
+ export declare function isHistoirePluginNotice(type: string): type is HistoirePluginNotice;
52
+ /** Validates a plugin id against the shared grammar. */
53
+ export declare function isHistoirePluginId(value: unknown): value is string;
54
+ /**
55
+ * Validates one plugin message in a single bounded traversal.
56
+ * @param value Untrusted payload.
57
+ * @param attributed Frame-to-host publication: requires `target` and `runtimeId`.
58
+ * @param notices Admits runtime notices; only frame-to-host traffic carries them.
59
+ */
60
+ export declare function validatePluginChannelPayload(value: unknown, attributed?: boolean, notices?: boolean): HistoirePluginChannelPayload;
61
+ /**
62
+ * Validates the descriptor inventory of installed frame plugins: unique ids, integer versions,
63
+ * nothing but `{ id, apiVersion }` (never module paths).
64
+ */
65
+ export declare function validateFramePluginInventory(value: unknown): HistoireFramePluginInfo[];
66
+ /**
67
+ * Rate windows per plugin and direction, reusing the host-channel limiter: one plugin saturating
68
+ * its window never charges another. Owners create one per runtime document.
69
+ * @param now Clock, injectable for tests.
70
+ */
71
+ export declare function createPluginChannelLimiters(now?: () => number): {
72
+ /** Limiter pair of one plugin, created on first use. */
73
+ get(pluginId: string): {
74
+ incoming: ReturnType<typeof createHostChannelRateLimiter>;
75
+ outgoing: ReturnType<typeof createHostChannelRateLimiter>;
76
+ };
77
+ /** Saturated drop count of one plugin across both directions. */
78
+ droppedCount(pluginId: string): number;
79
+ /** Replacement documents never inherit rate tokens or counts. */
80
+ reset(): void;
81
+ };
82
+ /** Per-plugin limiter set of one runtime document. */
83
+ export type HistoirePluginChannelLimiters = ReturnType<typeof createPluginChannelLimiters>;
84
+ //# sourceMappingURL=plugin-channels.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"plugin-channels.d.ts","sourceRoot":"","sources":["../src/plugin-channels.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAA;AAG1E,OAAO,EAAE,4BAA4B,EAAE,MAAM,eAAe,CAAA;AAE5D,sEAAsE;AACtE,eAAO,MAAM,iCAAiC,QAAY,CAAA;AAE1D,+FAA+F;AAC/F,eAAO,MAAM,0BAA0B,QAAsB,CAAA;AAE7D,sGAAsG;AAC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,IAAI,EAAE,MAAM,GAAG,IAAI,IAAI,oBAAoB,CAEjF;AAED,wDAAwD;AACxD,wBAAgB,kBAAkB,CAAC,KAAK,EAAE,OAAO,GAAG,KAAK,IAAI,MAAM,CAElE;AAaD;;;;;GAKG;AACH,wBAAgB,4BAA4B,CAAC,KAAK,EAAE,OAAO,EAAE,UAAU,UAAQ,EAAE,OAAO,UAAa,GAAG,4BAA4B,CAgBnI;AAED;;;GAGG;AACH,wBAAgB,4BAA4B,CAAC,KAAK,EAAE,OAAO,GAAG,uBAAuB,EAAE,CAYtF;AAED;;;;GAIG;AACH,wBAAgB,2BAA2B,CAAC,GAAG,GAAE,MAAM,MAAiB;IAGpE,wDAAwD;IACxD,GAAG,WAAW,MAAM;kBAHsB,UAAU,CAAC,OAAO,4BAA4B,CAAC;kBAAY,UAAU,CAAC,OAAO,4BAA4B,CAAC;;IAWpJ,iEAAiE;IACjE,YAAY,WAAW,MAAM,GAAG,MAAM;IAItC,iEAAiE;IACjE,KAAK;EAIR;AAED,sDAAsD;AACtD,MAAM,MAAM,6BAA6B,GAAG,UAAU,CAAC,OAAO,2BAA2B,CAAC,CAAA"}
@@ -0,0 +1,12 @@
1
+ /** One controls document owns revision counter; source wrapper keeps admitted watermark. */
2
+ export declare function createControlsStateRevision(): {
3
+ /** Last captured local edit or admitted child edit for this document only. */
4
+ readonly current: number;
5
+ /** Stamp edit before asynchronous postMessage can cross wrapper boundary. */
6
+ capture(): number;
7
+ /** Admit each child edit once, rejecting replay and malformed counters. */
8
+ receive(value: unknown): boolean;
9
+ /** New typing already captured locally makes older acknowledgment inapplicable. */
10
+ accept(value: unknown): boolean;
11
+ };
12
+ //# sourceMappingURL=controls-revision.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"controls-revision.d.ts","sourceRoot":"","sources":["../../src/serialization/controls-revision.ts"],"names":[],"mappings":"AAEA,4FAA4F;AAC5F,wBAAgB,2BAA2B;IAOvC,8EAA8E;aAC1E,OAAO,EAAI,MAAM;IACrB,6EAA6E;IAC7E,OAAO,IAAI,MAAM;IAIjB,2EAA2E;IAC3E,OAAO,QAAQ,OAAO,GAAG,OAAO;IAMhC,mFAAmF;IACnF,MAAM,QAAQ,OAAO,GAAG,OAAO;EAIlC"}
@@ -0,0 +1,12 @@
1
+ /** State containers received through the serializable iframe bridge. */
2
+ type StateContainer = Record<string | number, any>;
3
+ /**
4
+ * Applies serializable fields without replacing runtime-owned objects or callbacks.
5
+ * Unlike local applyState, the source has lost functions and prototypes in transit:
6
+ * assigning a whole nested object or array would erase those values in the iframe.
7
+ * Returns whether any reactive field changed, so an unchanged snapshot arms no echo guard.
8
+ * Reset additionally prunes added serializable fields while retaining opaque owners.
9
+ */
10
+ export declare function applySerializedState(target: StateContainer, source: StateContainer, reset?: boolean): boolean;
11
+ export {};
12
+ //# sourceMappingURL=state.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"state.d.ts","sourceRoot":"","sources":["../../src/serialization/state.ts"],"names":[],"mappings":"AAAA,wEAAwE;AACxE,KAAK,cAAc,GAAG,MAAM,CAAC,MAAM,GAAG,MAAM,EAAE,GAAG,CAAC,CAAA;AAOlD;;;;;;GAMG;AACH,wBAAgB,oBAAoB,CAAC,MAAM,EAAE,cAAc,EAAE,MAAM,EAAE,cAAc,EAAE,KAAK,UAAQ,WA6HjG"}
@@ -0,0 +1,8 @@
1
+ import type { HistoireTestError } from '../types/test.js';
2
+ /** Projects runtime error while omitting absent fields required by JSON DTOs. */
3
+ export declare function serializeTestError(error: unknown): HistoireTestError;
4
+ /** Applies same projection to every lifecycle/assertion error. */
5
+ export declare function serializeTestErrors(errors: unknown[]): HistoireTestError[];
6
+ /** Renders transported failure text while stripping terminal-only color escapes. */
7
+ export declare function formatTestError(error: HistoireTestError): string;
8
+ //# sourceMappingURL=test-errors.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"test-errors.d.ts","sourceRoot":"","sources":["../../src/serialization/test-errors.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,kBAAkB,CAAA;AAuBzD,iFAAiF;AACjF,wBAAgB,kBAAkB,CAAC,KAAK,EAAE,OAAO,GAAG,iBAAiB,CA2CpE;AAED,kEAAkE;AAClE,wBAAgB,mBAAmB,CAAC,MAAM,EAAE,OAAO,EAAE,GAAG,iBAAiB,EAAE,CAE1E;AAUD,oFAAoF;AACpF,wBAAgB,eAAe,CAAC,KAAK,EAAE,iBAAiB,GAAG,MAAM,CAShE"}
@@ -0,0 +1,17 @@
1
+ /** Portable parsed CSS color, retaining source mode/alpha for compatible callers. */
2
+ export interface HistoireParsedColor {
3
+ /** Supported functional mode. */
4
+ mode: 'rgb' | 'hsl';
5
+ /** Exactly three component values. */
6
+ color: [string, string, string];
7
+ /** Optional CSS number/percentage alpha. */
8
+ alpha?: string;
9
+ }
10
+ /** Dependency-free CSS color parser shared by Node theme output and native providers. */
11
+ export declare function parseColor(input: unknown): HistoireParsedColor | null;
12
+ /** Convert HSL/percent RGB to numeric RGB channels; CSS alpha remains independent of utility opacity. */
13
+ export declare function getHistoireColorChannels(parsed: HistoireParsedColor): {
14
+ channels: string;
15
+ alpha: string;
16
+ };
17
+ //# sourceMappingURL=color.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"color.d.ts","sourceRoot":"","sources":["../../src/theme/color.ts"],"names":[],"mappings":"AAAA,qFAAqF;AACrF,MAAM,WAAW,mBAAmB;IAClC,iCAAiC;IACjC,IAAI,EAAE,KAAK,GAAG,KAAK,CAAA;IACnB,sCAAsC;IACtC,KAAK,EAAE,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC,CAAA;IAC/B,4CAA4C;IAC5C,KAAK,CAAC,EAAE,MAAM,CAAA;CACf;AAQD,yFAAyF;AACzF,wBAAgB,UAAU,CAAC,KAAK,EAAE,OAAO,GAAG,mBAAmB,GAAG,IAAI,CAUrE;AAED,yGAAyG;AACzG,wBAAgB,wBAAwB,CAAC,MAAM,EAAE,mBAAmB,GAAG;IAAE,QAAQ,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,MAAM,CAAA;CAAE,CAoBzG"}
@@ -0,0 +1,32 @@
1
+ /** Default source neutral palette, distinct from authored C1 semantic surfaces. */
2
+ export declare const histoireDefaultNeutralColors: {
3
+ readonly 50: '#fafafa';
4
+ readonly 100: '#f4f4f5';
5
+ readonly 200: '#e4e4e7';
6
+ readonly 300: '#d4d4d8';
7
+ readonly 400: '#a1a1aa';
8
+ readonly 500: '#71717a';
9
+ readonly 600: '#52525b';
10
+ readonly 700: '#3f3f46';
11
+ readonly 750: '#323238';
12
+ readonly 800: '#27272a';
13
+ readonly 850: '#1f1f21';
14
+ readonly 900: '#18181b';
15
+ readonly 950: '#101012';
16
+ };
17
+ /** Default source accent palette used by utility colors and project overrides. */
18
+ export declare const histoireDefaultAccentColors: {
19
+ readonly 50: '#ecfdf5';
20
+ readonly 100: '#d1fae5';
21
+ readonly 200: '#a7f3d0';
22
+ readonly 300: '#6ee7b7';
23
+ readonly 400: '#34d399';
24
+ readonly 500: '#10b981';
25
+ readonly 600: '#059669';
26
+ readonly 700: '#047857';
27
+ readonly 800: '#065f46';
28
+ readonly 900: '#064e3b';
29
+ };
30
+ /** Emit customized shades only; resolved default source colors must not replace C1 defaults. */
31
+ export declare function getHistoireSemanticThemeOverrides(colors?: Record<string, Record<string, unknown>>, dark?: boolean): Record<string, string>;
32
+ //# sourceMappingURL=semantic.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"semantic.d.ts","sourceRoot":"","sources":["../../src/theme/semantic.ts"],"names":[],"mappings":"AAEA,mFAAmF;AACnF,eAAO,MAAM,4BAA4B;aACvC,EAAE,EAAE,SAAS;aACb,GAAG,EAAE,SAAS;aACd,GAAG,EAAE,SAAS;aACd,GAAG,EAAE,SAAS;aACd,GAAG,EAAE,SAAS;aACd,GAAG,EAAE,SAAS;aACd,GAAG,EAAE,SAAS;aACd,GAAG,EAAE,SAAS;aACd,GAAG,EAAE,SAAS;aACd,GAAG,EAAE,SAAS;aACd,GAAG,EAAE,SAAS;aACd,GAAG,EAAE,SAAS;aACd,GAAG,EAAE,SAAS;CACN,CAAA;AAEV,kFAAkF;AAClF,eAAO,MAAM,2BAA2B;aACtC,EAAE,EAAE,SAAS;aACb,GAAG,EAAE,SAAS;aACd,GAAG,EAAE,SAAS;aACd,GAAG,EAAE,SAAS;aACd,GAAG,EAAE,SAAS;aACd,GAAG,EAAE,SAAS;aACd,GAAG,EAAE,SAAS;aACd,GAAG,EAAE,SAAS;aACd,GAAG,EAAE,SAAS;aACd,GAAG,EAAE,SAAS;CACN,CAAA;AAaV,gGAAgG;AAChG,wBAAgB,iCAAiC,CAAC,MAAM,GAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAM,EAAE,IAAI,UAAQ,GAAG,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAa5I"}
@@ -0,0 +1,172 @@
1
+ import type { HistoireMatrixHint } from '../helpers/matrix.js';
2
+ import type { HistoireMeta } from '../helpers/meta.js';
3
+ import type { HistoireFramePluginInfo } from '../plugin-channels.js';
4
+ import type { HistoireCapabilities, HistoireTarget } from './common.js';
5
+ import type { HistoireInspectionCapabilities } from './inspection.js';
6
+ import type { HistoireEmbedPolicy, HistoireSourceAssets, HistoireSourceConfig } from './source-descriptor.js';
7
+ /** Ownership of one collected story file relative to the user project. */
8
+ export type HistoireStoryFileOrigin = 'project' | 'generated' | 'external';
9
+ /** Legacy descriptors omitted provenance and represented ordinary project stories. */
10
+ export declare function isHistoireProjectFileOrigin(origin: HistoireStoryFileOrigin | undefined): boolean;
11
+ /** Projected collection issue without internal stack/path/context. */
12
+ export interface HistoireDiagnostic {
13
+ /** Stable diagnostic kind. */
14
+ code: string;
15
+ /** User-facing collection detail. */
16
+ message: string;
17
+ /** Related collected story when known. */
18
+ storyId?: string;
19
+ /** Portable relative file label. */
20
+ relativePath?: string;
21
+ /** Diagnostic severity. */
22
+ severity: 'warning' | 'error';
23
+ }
24
+ /** Portable variant metadata; no slots/components/callbacks. */
25
+ export interface HistoireCatalogVariant {
26
+ /** Exact variant identity scoped to story. */
27
+ id: string;
28
+ /** Display title. */
29
+ title: string;
30
+ /** Optional projected icon. */
31
+ icon?: string;
32
+ /** Whether collection observed tests. */
33
+ hasTests?: boolean;
34
+ /** Available content modes. */
35
+ source?: {
36
+ raw: boolean;
37
+ dynamic: boolean;
38
+ };
39
+ /** JSON part of collected variant `meta`, read by workbench plugins. */
40
+ meta?: HistoireMeta;
41
+ }
42
+ /** Story-declared frame geometry in CSS pixels; omitted values follow the canvas viewport. */
43
+ export interface HistoireStoryFrame {
44
+ /** Variant width, replacing the canvas viewport width. */
45
+ width?: number;
46
+ /** Variant height, replacing the canvas viewport height. */
47
+ height?: number;
48
+ /** Space around the variant, its corners marked by aligners. */
49
+ padding?: number;
50
+ }
51
+ /** Portable story metadata used by every source projection. */
52
+ export interface HistoireCatalogStory {
53
+ /** Exact collected ID. */
54
+ id: string;
55
+ /** Display title. */
56
+ title: string;
57
+ /** Nested group/folder path. */
58
+ path: readonly string[];
59
+ /** Group identifier. */
60
+ group?: string;
61
+ /** Optional icon name. */
62
+ icon?: string;
63
+ /** Optional icon color. */
64
+ iconColor?: string;
65
+ /** Standalone documentation story. */
66
+ docsOnly: boolean;
67
+ /** Preview layout advertised by source. */
68
+ layout?: {
69
+ type: 'single' | 'grid';
70
+ } & HistoireStoryFrame;
71
+ /** Explicit layout declaration, absent on older sources. */
72
+ layoutExplicit?: boolean;
73
+ /** Finite prop domains for two-axis preview matrices. */
74
+ matrix?: HistoireMatrixHint;
75
+ /** Whether collection saw a `controls` slot; absent when the support plugin can't tell. */
76
+ hasCustomControls?: boolean;
77
+ /** Support plugin identity without loader. */
78
+ supportPluginId?: string;
79
+ /** SHA-256 of canonical story source and executable metadata; absent means conservative reload. */
80
+ runtimeRevision?: string;
81
+ /** Relative project file label. */
82
+ relativePath?: string;
83
+ /** File ownership; absent only on compatible older source descriptors. */
84
+ fileOrigin?: HistoireStoryFileOrigin;
85
+ /** JSON part of collected story `meta`, read by workbench plugins. */
86
+ meta?: HistoireMeta;
87
+ /** Collected variants in selection order. */
88
+ variants: readonly HistoireCatalogVariant[];
89
+ /** Available static documentation and source. */
90
+ content: {
91
+ docs: boolean;
92
+ rawSource: boolean;
93
+ };
94
+ }
95
+ /** Stable tree nodes name stories, never catalog array offsets. */
96
+ export type HistoireCatalogTreeNode = {
97
+ kind: 'story';
98
+ title: string;
99
+ storyId: string;
100
+ } | {
101
+ kind: 'folder' | 'group';
102
+ title: string;
103
+ id?: string;
104
+ children: readonly HistoireCatalogTreeNode[];
105
+ };
106
+ /** Immutable completed catalog projection. */
107
+ export interface HistoireCatalog {
108
+ /** Stories in source order; duplicate IDs diagnosed by source. */
109
+ stories: readonly HistoireCatalogStory[];
110
+ /** Navigation tree using exact IDs. */
111
+ tree: readonly HistoireCatalogTreeNode[];
112
+ /** Completed collection issues. */
113
+ diagnostics: readonly HistoireDiagnostic[];
114
+ }
115
+ /** Ranked target from title or documentation search. */
116
+ export interface HistoireSearchResult {
117
+ /** Exact activation target. */
118
+ target: HistoireTarget;
119
+ /** Search source. */
120
+ kind: 'story' | 'variant' | 'docs';
121
+ /** Display label. */
122
+ title: string;
123
+ /** Consecutive source order after relevance sorting and deduplication. */
124
+ rank: number;
125
+ /** Optional matching evidence shared by source search and loaded props. */
126
+ match?: {
127
+ /** Whether literal matching or typo fallback produced this result. */
128
+ mode: 'literal' | 'fuzzy';
129
+ /** Comparable relevance score; lower values sort first. */
130
+ score: number;
131
+ };
132
+ /** Optional plain text excerpt. */
133
+ excerpt?: string;
134
+ /** Panel-local documentation anchor. */
135
+ anchor?: string;
136
+ }
137
+ /** Versioned source descriptor, with heavy content kept out of catalog. */
138
+ export interface HistoireSourceDescriptor {
139
+ /** Descriptor schema version. */
140
+ descriptorVersion: 1;
141
+ /** Supported bridge protocol version. */
142
+ protocolVersion: 1;
143
+ /** Stable book identity. */
144
+ sourceId: string;
145
+ /** Current source generation. */
146
+ epoch: string;
147
+ /** Completed source publication. */
148
+ revision: string;
149
+ /** Available source engine. */
150
+ mode: 'dev' | 'static';
151
+ /** Portable catalog projection. */
152
+ catalog: HistoireCatalog;
153
+ /** Source-supported engines and surfaces. */
154
+ capabilities: HistoireCapabilities;
155
+ /** Optional inspection support; absence denies access. */
156
+ inspection?: HistoireInspectionCapabilities;
157
+ /** Additional exact-origin restriction for inspection. */
158
+ inspectionPolicy?: {
159
+ allowedOrigins: readonly string[];
160
+ };
161
+ /** Portable source appearance populated by first-party dev/static adapters. */
162
+ config?: HistoireSourceConfig;
163
+ /** Project gutter around embedded variants whose story layout sets no `padding`. */
164
+ framePadding?: number;
165
+ /** Exact document parent-origin policy. */
166
+ embed?: HistoireEmbedPolicy;
167
+ /** Lazy same-book content/search inventory. */
168
+ assets?: HistoireSourceAssets;
169
+ /** Installed frame plugins (`{ id, apiVersion }` only); absent when the book has none. */
170
+ framePlugins?: readonly HistoireFramePluginInfo[];
171
+ }
172
+ //# sourceMappingURL=catalog.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"catalog.d.ts","sourceRoot":"","sources":["../../src/types/catalog.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAA;AAC9D,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAA;AACtD,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,uBAAuB,CAAA;AACpE,OAAO,KAAK,EAAE,oBAAoB,EAAE,cAAc,EAAE,MAAM,aAAa,CAAA;AACvE,OAAO,KAAK,EAAE,8BAA8B,EAAE,MAAM,iBAAiB,CAAA;AACrE,OAAO,KAAK,EAAE,mBAAmB,EAAE,oBAAoB,EAAE,oBAAoB,EAAE,MAAM,wBAAwB,CAAA;AAE7G,0EAA0E;AAC1E,MAAM,MAAM,uBAAuB,GAAG,SAAS,GAA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E,CAAA;KAAE,CAAA;IACxD,+EAA+E;IAC/E,MAAM,CAAC,EAAE,oBAAoB,CAAA;IAC7B,oFAAoF;IACpF,YAAY,CAAC,EAAE,MAAM,CAAA;IACrB,2CAA2C;IAC3C,KAAK,CAAC,EAAE,mBAAmB,CAAA;IAC3B,+CAA+C;IAC/C,MAAM,CAAC,EAAE,oBAAoB,CAAA;IAC7B,0FAA0F;IAC1F,YAAY,CAAC,EAAE,SAAS,uBAAuB,EAAE,CAAA;CAClD"}
@@ -0,0 +1,59 @@
1
+ /** JSON DTO primitives; state transport additionally accepts undefined and BigInt. */
2
+ export type HistoireJsonValue = null | boolean | number | string | HistoireJsonValue[] | {
3
+ [key: string]: HistoireJsonValue;
4
+ };
5
+ /** Exact selected target; null retains story without a selected variant. */
6
+ export interface HistoireTarget {
7
+ /** Collected story ID, preserved byte-for-byte. */
8
+ storyId: string;
9
+ /** Collected variant ID or explicit lack of variant. */
10
+ variantId: string | null;
11
+ }
12
+ /** Selection input; omitted variant restores remembered choice or first variant. */
13
+ export interface HistoireSelectionInput {
14
+ /** Collected story ID. */
15
+ storyId: string;
16
+ /** Explicit null requests story-only selection. */
17
+ variantId?: string | null;
18
+ }
19
+ /** All independently mountable first-party surfaces. */
20
+ export declare const HISTOIRE_SURFACES: readonly ['explorer', 'preview', 'tree', 'search', 'toolbar', 'controls', 'docs', 'source', 'events', 'tests'];
21
+ /** One independently mountable first-party surface name. */
22
+ export type HistoireSurface = typeof HISTOIRE_SURFACES[number];
23
+ /** Typed reason carried by unavailable capability entries. */
24
+ export interface HistoireCapability {
25
+ /** Whether operation is currently supported and ready. */
26
+ available: boolean;
27
+ /** Opt-in channel names; only meaningful for hostChannels capability. */
28
+ channels?: readonly string[];
29
+ /** Typed failure code or human-readable source reason. */
30
+ reason?: string;
31
+ }
32
+ /** Effective operation keys, distinct from source engine support. */
33
+ export type HistoireCapabilityName = 'catalog' | 'search' | 'docs' | 'rawSource' | 'dynamicSource' | 'state' | 'customControls' | 'previewTests' | 'serverTests' | 'openInEditor' | 'hostChannels';
34
+ /** Named engine/operation and per-surface availability. */
35
+ export type HistoireCapabilities = Record<HistoireCapabilityName, HistoireCapability> & {
36
+ /** Per-surface availability. */
37
+ surfaces: Record<HistoireSurface, HistoireCapability>;
38
+ /**
39
+ * Frame plugin messaging; advertised only by books with frame plugins (descriptor `framePlugins`),
40
+ * so books without them keep the shape older SDKs validate.
41
+ */
42
+ framePlugins?: HistoireCapability;
43
+ };
44
+ /** Stable source identity and last completed content publication. */
45
+ export interface HistoireSourceIdentity {
46
+ /** Opaque source identity; never absolute project path. */
47
+ sourceId: string;
48
+ /** Normalized HTTP(S) book base URL. */
49
+ url: string;
50
+ /** Available source engine. */
51
+ mode: 'dev' | 'static';
52
+ /** Source generation lifetime. */
53
+ epoch: string;
54
+ /** Completed content/catalog publication. */
55
+ revision: string;
56
+ }
57
+ /** Injective tuple encoding; never parse separator-concatenated IDs. */
58
+ export declare function getHistoireTargetKey(target: HistoireTarget): string;
59
+ //# sourceMappingURL=common.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"common.d.ts","sourceRoot":"","sources":["../../src/types/common.ts"],"names":[],"mappings":"AAAA,sFAAsF;AACtF,MAAM,MAAM,iBAAiB,GAAG,IAAI,GAAG,OAAO,GAAG,MAAM,GAAG,MAAM,GAAG,iBAAiB,EAAE,GAAG;IAAE,CAAC,GAAG,EAAE,MAAM,GAAG,iBAAiB,CAAA;CAAE,CAAA;AAE7H,4EAA4E;AAC5E,MAAM,WAAW,cAAc;IAC7B,mDAAmD;IACnD,OAAO,EAAE,MAAM,CAAA;IACf,wDAAwD;IACxD,SAAS,EAAE,MAAM,GAAG,IAAI,CAAA;CACzB;AAED,oFAAoF;AACpF,MAAM,WAAW,sBAAsB;IACrC,0BAA0B;IAC1B,OAAO,EAAE,MAAM,CAAA;IACf,mDAAmD;IACnD,SAAS,CAAC,EAAE,MAAM,GAAG,IAAI,CAAA;CAC1B;AAED,wDAAwD;AACxD,e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nE"}
@@ -0,0 +1,34 @@
1
+ /** Metadata common to lazy documentation/source results. */
2
+ export interface HistoireContentIdentity {
3
+ /** Collected story ID. */
4
+ storyId: string;
5
+ /** Optional variant attribution. */
6
+ variantId?: string;
7
+ /** Captured source generation. */
8
+ epoch: string;
9
+ /** Captured completed publication. */
10
+ revision: string;
11
+ /** Portable relative content label. */
12
+ relativePath?: string;
13
+ }
14
+ /** Lazy docs result; unavailable/empty are distinct. */
15
+ export interface HistoireDocsContent extends HistoireContentIdentity {
16
+ /** Association/transform source. */
17
+ origin: 'sibling' | 'standalone' | 'inline' | 'collected';
18
+ /** Rendering policy is chosen by consumer. */
19
+ format: 'html' | 'text';
20
+ /** Present content, which may intentionally be empty. */
21
+ body: string;
22
+ }
23
+ /** Source text; dynamic output belongs to active story runtime. */
24
+ export interface HistoireSourceContent extends HistoireContentIdentity {
25
+ /** Source execution mode. */
26
+ mode: 'raw' | 'dynamic';
27
+ /** Physical file, virtual file, or generated runtime text. */
28
+ origin: 'file' | 'virtual' | 'generated' | 'explicit' | 'slot';
29
+ /** Syntax label. */
30
+ language?: string;
31
+ /** Source text, never executable loader. */
32
+ body: string;
33
+ }
34
+ //# sourceMappingURL=content.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"content.d.ts","sourceRoot":"","sources":["../../src/types/content.ts"],"names":[],"mappings":"AAAA,4DAA4D;AAC5D,MAAM,WAAW,uBAAuB;IACtC,0BAA0B;IAC1B,OAAO,EAAE,MAAM,CAAA;IACf,oCAAoC;IACpC,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,kCAAkC;IAClC,KAAK,EAAE,MAAM,CAAA;IACb,sCAAsC;IACtC,QAAQ,EAAE,MAAM,CAAA;IAChB,uCAAuC;IACvC,YAAY,CAAC,EAAE,MAAM,CAAA;CACtB;AAED,wDAAwD;AACxD,MAAM,WAAW,mBAAoB,SAAQ,uBAAuB;IAClE,oCAAoC;IACpC,MAAM,EAAE,SAAS,GAAG,YAAY,GAAG,QAAQ,GAAG,WAAW,CAAA;IACzD,8CAA8C;IAC9C,MAAM,EAAE,MAAM,GAAG,MAAM,CAAA;IACvB,yDAAyD;IACzD,IAAI,EAAE,MAAM,CAAA;CACb;AAED,mEAAmE;AACnE,MAAM,WAAW,qBAAsB,SAAQ,uBAAuB;IACpE,6BAA6B;IAC7B,IAAI,EAAE,KAAK,GAAG,SAAS,CAAA;IACvB,8DAA8D;IAC9D,MAAM,EAAE,MAAM,GAAG,SAAS,GAAG,WAAW,GAAG,UAAU,GAAG,MAAM,CAAA;IAC9D,oBAAoB;IACpB,QAAQ,CAAC,EAAE,MAAM,CAAA;IACjB,4CAA4C;IAC5C,IAAI,EAAE,MAAM,CAAA;CACb"}