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

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 (112) 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-route.d.ts +25 -0
  43. package/dist/helpers/story-route.d.ts.map +1 -0
  44. package/dist/index.d.ts +50 -0
  45. package/dist/index.d.ts.map +1 -0
  46. package/dist/index.js +3288 -0
  47. package/dist/inspection/capabilities.d.ts +24 -0
  48. package/dist/inspection/capabilities.d.ts.map +1 -0
  49. package/dist/inspection/debug-buffer.d.ts +21 -0
  50. package/dist/inspection/debug-buffer.d.ts.map +1 -0
  51. package/dist/inspection/extensions.d.ts +5 -0
  52. package/dist/inspection/extensions.d.ts.map +1 -0
  53. package/dist/inspection/rows.d.ts +5 -0
  54. package/dist/inspection/rows.d.ts.map +1 -0
  55. package/dist/inspection/validation.d.ts +23 -0
  56. package/dist/inspection/validation.d.ts.map +1 -0
  57. package/dist/plugin-channels.d.ts +84 -0
  58. package/dist/plugin-channels.d.ts.map +1 -0
  59. package/dist/serialization/controls-revision.d.ts +12 -0
  60. package/dist/serialization/controls-revision.d.ts.map +1 -0
  61. package/dist/serialization/state.d.ts +12 -0
  62. package/dist/serialization/state.d.ts.map +1 -0
  63. package/dist/serialization/test-errors.d.ts +8 -0
  64. package/dist/serialization/test-errors.d.ts.map +1 -0
  65. package/dist/theme/color.d.ts +17 -0
  66. package/dist/theme/color.d.ts.map +1 -0
  67. package/dist/theme/semantic.d.ts +32 -0
  68. package/dist/theme/semantic.d.ts.map +1 -0
  69. package/dist/types/catalog.d.ts +161 -0
  70. package/dist/types/catalog.d.ts.map +1 -0
  71. package/dist/types/common.d.ts +59 -0
  72. package/dist/types/common.d.ts.map +1 -0
  73. package/dist/types/content.d.ts +34 -0
  74. package/dist/types/content.d.ts.map +1 -0
  75. package/dist/types/controls.d.ts +132 -0
  76. package/dist/types/controls.d.ts.map +1 -0
  77. package/dist/types/debug.d.ts +64 -0
  78. package/dist/types/debug.d.ts.map +1 -0
  79. package/dist/types/embed-presentation.d.ts +23 -0
  80. package/dist/types/embed-presentation.d.ts.map +1 -0
  81. package/dist/types/error.d.ts +23 -0
  82. package/dist/types/error.d.ts.map +1 -0
  83. package/dist/types/inspection-accessibility.d.ts +43 -0
  84. package/dist/types/inspection-accessibility.d.ts.map +1 -0
  85. package/dist/types/inspection-components.d.ts +69 -0
  86. package/dist/types/inspection-components.d.ts.map +1 -0
  87. package/dist/types/inspection.d.ts +221 -0
  88. package/dist/types/inspection.d.ts.map +1 -0
  89. package/dist/types/isolated-inspection.d.ts +69 -0
  90. package/dist/types/isolated-inspection.d.ts.map +1 -0
  91. package/dist/types/preview-message.d.ts +179 -0
  92. package/dist/types/preview-message.d.ts.map +1 -0
  93. package/dist/types/readonly.d.ts +5 -0
  94. package/dist/types/readonly.d.ts.map +1 -0
  95. package/dist/types/settings.d.ts +31 -0
  96. package/dist/types/settings.d.ts.map +1 -0
  97. package/dist/types/snapshot.d.ts +94 -0
  98. package/dist/types/snapshot.d.ts.map +1 -0
  99. package/dist/types/source-descriptor.d.ts +72 -0
  100. package/dist/types/source-descriptor.d.ts.map +1 -0
  101. package/dist/types/source-search.d.ts +20 -0
  102. package/dist/types/source-search.d.ts.map +1 -0
  103. package/dist/types/test.d.ts +208 -0
  104. package/dist/types/test.d.ts.map +1 -0
  105. package/dist/url/embed-origins.d.ts +16 -0
  106. package/dist/url/embed-origins.d.ts.map +1 -0
  107. package/dist/url/embed.d.ts +19 -0
  108. package/dist/url/embed.d.ts.map +1 -0
  109. package/dist/url/preview.d.ts +14 -0
  110. package/dist/url/preview.d.ts.map +1 -0
  111. package/package.json +32 -3
  112. package/README.md +0 -3
@@ -0,0 +1,69 @@
1
+ import type { HistoireDomProjection, HistoireVariantProjection } from './inspection.js';
2
+ /** Shared isolated observation identity, independent of MCP retention. */
3
+ export interface HistoireIsolatedInspectionBase {
4
+ /** Exact registered story. */
5
+ storyId: string;
6
+ /** Exact mounted variant. */
7
+ variantId: string;
8
+ /** CSS viewport used for the fresh document. */
9
+ viewport: {
10
+ width: number;
11
+ height: number;
12
+ };
13
+ /** Work or byte limits omitted content. */
14
+ truncated: boolean;
15
+ }
16
+ /** Bounded sanitized browser event. */
17
+ export interface HistoireRuntimeDiagnostic {
18
+ /** Observed event category. */
19
+ kind: 'console' | 'page-error' | 'request-failed' | 'http-error';
20
+ /** Console severity. */
21
+ level?: string;
22
+ /** Sanitized text, without raw arguments. */
23
+ message: string;
24
+ /** HTTP URL without credentials, query or fragment. */
25
+ url?: string;
26
+ /** HTTP response status. */
27
+ status?: number;
28
+ }
29
+ /** Fresh browser observations with stable legacy discriminator shapes. */
30
+ export type HistoireIsolatedInspection = HistoireIsolatedInspectionBase & ((HistoireVariantProjection & {
31
+ inspection: 'variant';
32
+ }) | (HistoireDomProjection & {
33
+ inspection: 'dom';
34
+ }) | {
35
+ inspection: 'accessibility';
36
+ matched: boolean;
37
+ snapshot: string;
38
+ totalCharacters: number;
39
+ } | {
40
+ inspection: 'diagnostics';
41
+ previewReady: boolean;
42
+ readinessError?: string;
43
+ entries: HistoireRuntimeDiagnostic[];
44
+ droppedCount: number;
45
+ });
46
+ /** Finite isolated service operations. ARIA is distinct from axe. */
47
+ export type HistoireIsolatedInspectionKind = 'inspect-variant' | 'inspect-dom' | 'inspect-accessibility' | 'runtime-diagnostics';
48
+ /** Normalized bounded service arguments; public adapters validate before admission. */
49
+ export interface HistoireIsolatedInspectionInput {
50
+ /** Exact registered story. */
51
+ storyId: string;
52
+ /** Exact variant. */
53
+ variantId: string;
54
+ /** CSS width. */
55
+ width: number;
56
+ /** CSS height. */
57
+ height: number;
58
+ /** Root CSS query. */
59
+ selector?: string;
60
+ /** Retained DOM nodes. */
61
+ maxNodes?: number;
62
+ /** DOM traversal depth. */
63
+ maxDepth?: number;
64
+ /** Retained ARIA characters. */
65
+ maxCharacters?: number;
66
+ /** Additional diagnostic observation milliseconds. */
67
+ observationMs?: number;
68
+ }
69
+ //# sourceMappingURL=isolated-inspection.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"isolated-inspection.d.ts","sourceRoot":"","sources":["../../src/types/isolated-inspection.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,qBAAqB,EAAE,yBAAyB,EAAE,MAAM,iBAAiB,CAAA;AAEvF,0EAA0E;AAC1E,MAAM,WAAW,8BAA8B;IAC7C,8BAA8B;IAC9B,OAAO,EAAE,MAAM,CAAA;IACf,6BAA6B;IAC7B,SAAS,EAAE,MAAM,CAAA;IACjB,gDAAgD;IAChD,QAAQ,EAAE;QAAE,KAAK,EAAE,MAAM,CAAC;QAAC,MAAM,EAAE,MAAM,CAAA;KAAE,CAAA;IAC3C,2CAA2C;IAC3C,SAAS,EAAE,OAAO,CAAA;CACnB;AACD,uCAAuC;AACvC,MAAM,WAAW,yBAAyB;IACxC,+BAA+B;IAC/B,IAAI,EAAE,SAAS,GAAG,YAAY,GAAG,gBAAgB,GAAG,YAAY,CAAA;IAChE,wBAAwB;IACxB,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,6CAA6C;IAC7C,OAAO,EAAE,MAAM,CAAA;IACf,uDAAuD;IACvD,GAAG,CAAC,EAAE,MAAM,CAAA;IACZ,4BAA4B;IAC5B,MAAM,CAAC,EAAE,MAAM,CAAA;CAChB;AACD,0EAA0E;AAC1E,MAAM,MAAM,0BAA0B,GAAG,8BAA8B,GAAG,CACxE,CAAE,yBAAyB,GAAG;IAAE,UAAU,EAAE,SAAS,CAAA;CAAE,KACrD,qBAAqB,GAAG;IAAE,UAAU,EAAE,KAAK,CAAA;CAAE,IAC7C;IAAE,UAAU,EAAE,eAAe,CAAC;IAAC,OAAO,EAAE,OAAO,CAAC;IAAC,QAAQ,EAAE,MAAM,CAAC;IAAC,eAAe,EAAE,MAAM,CAAA;CAAE,GAC5F;IAAE,UAAU,EAAE,aAAa,CAAC;IAAC,YAAY,EAAE,OAAO,CAAC;IAAC,cAAc,CAAC,EAAE,MAAM,CAAC;IAAC,OAAO,EAAE,yBAAyB,EAAE,CAAC;IAAC,YAAY,EAAE,MAAM,CAAA;CAAE,CAC5I,CAAA;AACD,qEAAqE;AACrE,MAAM,MAAM,8BAA8B,GAAG,iBAAiB,GAAG,aAAa,GAAG,uBAAuB,GAAG,qBAAqB,CAAA;AAChI,uFAAuF;AACvF,MAAM,WAAW,+BAA+B;IAC9C,8BAA8B;IAC9B,OAAO,EAAE,MAAM,CAAA;IACf,qBAAqB;IACrB,SAAS,EAAE,MAAM,CAAA;IACjB,iBAAiB;IACjB,KAAK,EAAE,MAAM,CAAA;IACb,kBAAkB;IAClB,MAAM,EAAE,MAAM,CAAA;IACd,sBAAsB;IACtB,QAAQ,CAAC,EAAE,MAAM,CAAA;IACjB,0BAA0B;IAC1B,QAAQ,CAAC,EAAE,MAAM,CAAA;IACjB,2BAA2B;IAC3B,QAAQ,CAAC,EAAE,MAAM,CAAA;IACjB,gCAAgC;IAChC,aAAa,CAAC,EAAE,MAAM,CAAA;IACtB,sDAAsD;IACtD,aAAa,CAAC,EAAE,MAAM,CAAA;CACvB"}
@@ -0,0 +1,179 @@
1
+ import type { HistoireHostChannelPayload } from '../channels.js';
2
+ import type { HistoirePluginChannelPayload } from '../plugin-channels.js';
3
+ import type { HistoireControlsAppearanceMessage, HistoireControlsOverlayMessage, HistoireControlsOverlayRefreshMessage, HistoireControlsOverlayResultMessage } from './controls.js';
4
+ import type { HistoireCollectTestsPayload, HistoireRunTestCasePayload, HistoireRunTestsPayload, HistoireSerializedTestDefinition, HistoireTestCaseResultPayload, HistoireTestError, HistoireTestRunSummary } from './test.js';
5
+ /**
6
+ * Message types of the host <-> preview iframe postMessage protocol.
7
+ *
8
+ * Declared here rather than app-side because both ends read them: the app
9
+ * imports them directly, and the generated preview runtime imports the app's
10
+ * re-export. The payload types below are the only compiler check the protocol
11
+ * gets — the preview side is generated JavaScript.
12
+ */
13
+ export declare const STATE_SYNC = "__histoire:state-sync";
14
+ export declare const SANDBOX_READY = "__histoire:sandbox-ready";
15
+ export declare const EVENT_SEND = "__histoire:event";
16
+ export declare const PREVIEW_SETTINGS_SYNC = "__histoire:preview-settings-sync";
17
+ export declare const VARIANT_READY = "__histoire:variant-ready";
18
+ export declare const PREVIEW_SYNC = "__histoire:preview-sync";
19
+ export declare const CONTROLS_READY = "__histoire:controls-ready";
20
+ export declare const CONTROLS_RESIZE = "__histoire:controls-resize";
21
+ export declare const COLLECT_TESTS = "__histoire:collect-tests";
22
+ export declare const RUN_TESTS = "__histoire:run-tests";
23
+ export declare const RUN_TEST_CASE = "__histoire:run-test-case";
24
+ export declare const TEST_DEFINITIONS = "__histoire:test-definitions";
25
+ export declare const TEST_RESULT = "__histoire:test-result";
26
+ export declare const TEST_CASE_RESULT = "__histoire:test-case-result";
27
+ export declare const RUNTIME_REQUEST = "__histoire:runtime-request";
28
+ export declare const RUNTIME_RESULT = "__histoire:runtime-result";
29
+ export declare const RUNTIME_FAILED = "__histoire:runtime-failed";
30
+ export declare const RUNTIME_LAYOUT = "__histoire:runtime-layout";
31
+ export declare const RUNTIME_FOCUS = "__histoire:runtime-focus";
32
+ /** Application channel messages retain existing sandbox identity/origin guards. */
33
+ export declare const HOST_CHANNEL_MESSAGE = "__histoire:host-channel";
34
+ /** Data only, usable in either direction alongside correlated runtime requests. */
35
+ export interface HistoireHostChannelPreviewMessage extends HistoireStoryScopedMessage {
36
+ /** Finite protocol discriminator, separate from application-owned message type. */
37
+ type: typeof HOST_CHANNEL_MESSAGE;
38
+ /** Named JSON payload; no Histoire command or callback dispatch. */
39
+ channel: HistoireHostChannelPayload;
40
+ }
41
+ /**
42
+ * Plugin channel traffic shares the application-data discriminator, and with it the sandbox
43
+ * source, origin and document guards, but carries a `plugin` body instead of a channel name.
44
+ * Delivery follows `plugin.actorId`, never the selected variant.
45
+ */
46
+ export interface HistoirePluginChannelPreviewMessage extends HistoireStoryScopedMessage {
47
+ /** Same finite discriminator as host channels. */
48
+ type: typeof HOST_CHANNEL_MESSAGE;
49
+ /** Plugin message or runtime notice of one actor. */
50
+ plugin: HistoirePluginChannelPayload;
51
+ }
52
+ /** Finite first-party service request, bound to exact document and target. */
53
+ export interface HistoireRuntimeRequestMessage extends HistoireStoryScopedMessage {
54
+ /** Service dispatcher marker. */
55
+ type: typeof RUNTIME_REQUEST;
56
+ /** Correlated request lifetime. */
57
+ requestId: string;
58
+ /** Runtime-owned operation. */
59
+ command: 'state.get' | 'state.patch' | 'state.reset' | 'source.get' | 'channel.post' | 'plugin.post';
60
+ /** Isolated inspection read uses the getter-safe runtime projection. */
61
+ inspection?: true;
62
+ /** Isolated inspection authority must match the nonce host lease. */
63
+ mcpNonce?: string;
64
+ /** Isolated inspection authority must match the captured project epoch. */
65
+ mcpEpoch?: string;
66
+ /** Validated operation input. */
67
+ payload: unknown;
68
+ }
69
+ /** Marker every host <-> preview message carries; both ends drop messages without it. */
70
+ export interface HistoireMessageMarker {
71
+ __histoire: true;
72
+ /** Outbound document lifetime; iframe WindowProxy persists across navigation. */
73
+ documentId?: string;
74
+ }
75
+ /**
76
+ * Story a message belongs to.
77
+ *
78
+ * Carried by every message about a variant: the preview iframe keeps the same
79
+ * window across `src` navigations, so a message from a document being torn down
80
+ * still passes the source check and must be told apart by the story it names.
81
+ */
82
+ interface HistoireStoryScopedMessage {
83
+ storyId?: string | null;
84
+ variantId?: string | null;
85
+ }
86
+ /** Tells the preview which story/variant it should be showing. */
87
+ export interface HistoirePreviewSyncMessage {
88
+ type: typeof PREVIEW_SYNC;
89
+ storyId: string;
90
+ variantId: string | null;
91
+ }
92
+ /** One variant's state, sent in both directions. */
93
+ export interface HistoireStateSyncMessage extends HistoireStoryScopedMessage {
94
+ type: typeof STATE_SYNC;
95
+ variantId: string;
96
+ state: any;
97
+ /** Controls-only document edit watermark; primary frames omit it. */
98
+ controlsRevision?: number;
99
+ }
100
+ /** Preview settings (background, text direction…) pushed by the host. */
101
+ export interface HistoirePreviewSettingsSyncMessage {
102
+ type: typeof PREVIEW_SETTINGS_SYNC;
103
+ settings: Record<string, any>;
104
+ }
105
+ /** The preview document booted (and applied its initial selection). */
106
+ export interface HistoireSandboxReadyMessage extends HistoireStoryScopedMessage {
107
+ type: typeof SANDBOX_READY;
108
+ }
109
+ /** One variant finished rendering in the preview. */
110
+ export interface HistoireVariantReadyMessage extends HistoireStoryScopedMessage {
111
+ type: typeof VARIANT_READY;
112
+ }
113
+ /** The controls-only preview finished rendering the story's `#controls` slot. */
114
+ export interface HistoireControlsReadyMessage extends HistoireStoryScopedMessage {
115
+ type: typeof CONTROLS_READY;
116
+ /** Whether the story/variant actually provides a custom controls slot. */
117
+ hasControls: boolean;
118
+ }
119
+ /** New height of the controls-only preview document. */
120
+ export interface HistoireControlsResizeMessage {
121
+ type: typeof CONTROLS_RESIZE;
122
+ height: number;
123
+ }
124
+ /** A story event forwarded to the Events panel. */
125
+ export interface HistoireEventSendMessage {
126
+ type: typeof EVENT_SEND;
127
+ event: unknown;
128
+ }
129
+ /** Owned preview focus/search intent; finite presentation action, never arbitrary keyboard dispatch. */
130
+ export interface HistoireRuntimeFocusMessage extends HistoireStoryScopedMessage {
131
+ /** Focus publication discriminator. */
132
+ type: typeof RUNTIME_FOCUS;
133
+ /** Whether owned story document currently has focus. */
134
+ focused: boolean;
135
+ /** Explicit host UI action; other keys stay inside story. */
136
+ action?: 'search' | 'toggle-ui' | 'show-ui';
137
+ }
138
+ /** Host request: collect the tests a variant registers. */
139
+ export type HistoireCollectTestsMessage = HistoireCollectTestsPayload & {
140
+ type: typeof COLLECT_TESTS;
141
+ };
142
+ /** Host request: run the tests of a variant. */
143
+ export type HistoireRunTestsMessage = HistoireRunTestsPayload & {
144
+ type: typeof RUN_TESTS;
145
+ };
146
+ /** Host request for one case in a dedicated hidden runtime document. */
147
+ export type HistoireRunTestCaseMessage = HistoireRunTestCasePayload & {
148
+ type: typeof RUN_TEST_CASE;
149
+ };
150
+ /** Preview reply to {@link HistoireCollectTestsMessage}. */
151
+ export type HistoireTestDefinitionsMessage = HistoireCollectTestsPayload & {
152
+ type: typeof TEST_DEFINITIONS;
153
+ definitions: HistoireSerializedTestDefinition[];
154
+ /** Set when the preview-side collection crashed instead of returning definitions. */
155
+ error?: HistoireTestError | null;
156
+ };
157
+ /** Preview reply to {@link HistoireRunTestsMessage}. */
158
+ export type HistoireTestResultMessage = HistoireRunTestsPayload & {
159
+ type: typeof TEST_RESULT;
160
+ summary: HistoireTestRunSummary;
161
+ };
162
+ /** Hidden runtime reply for one isolated test case. */
163
+ export type HistoireTestCaseResultMessage = HistoireTestCaseResultPayload & {
164
+ type: typeof TEST_CASE_RESULT;
165
+ };
166
+ /** Every message the host posts into the preview iframe. */
167
+ export type HistoireHostMessage = HistoireHostChannelPreviewMessage | HistoirePluginChannelPreviewMessage | HistoireControlsAppearanceMessage | HistoireControlsOverlayRefreshMessage | HistoireControlsOverlayResultMessage | HistoirePreviewSyncMessage | HistoireStateSyncMessage | HistoirePreviewSettingsSyncMessage | HistoireCollectTestsMessage | HistoireRunTestsMessage | HistoireRunTestCaseMessage | HistoireRuntimeRequestMessage;
168
+ /** Every message the preview iframe posts back to the host. */
169
+ export type HistoirePreviewMessage = HistoireHostChannelPreviewMessage | HistoirePluginChannelPreviewMessage | HistoireControlsOverlayMessage | HistoireStateSyncMessage | HistoireSandboxReadyMessage | HistoireVariantReadyMessage | HistoireControlsReadyMessage | HistoireControlsResizeMessage | HistoireEventSendMessage | HistoireRuntimeFocusMessage | HistoireTestDefinitionsMessage | HistoireTestResultMessage | HistoireTestCaseResultMessage;
170
+ /**
171
+ * An inbound preview message as it is actually received: the payload crossed a
172
+ * postMessage boundary, so nothing guarantees it is well-formed.
173
+ */
174
+ export type HistoireInboundPreviewMessage = Partial<HistoirePreviewMessage> & {
175
+ type?: string;
176
+ [key: string]: any;
177
+ };
178
+ export {};
179
+ //# sourceMappingURL=preview-message.d.ts.map
@@ -0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GG;AACH,MAAM,MAAM,6BAA6B,GAAG,OAAO,CAAC,sBAAsB,CAAC,GAAG;IAC5E,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,CAAC,GAAG,EAAE,MAAM,GAAG,GAAG,CAAA;CACnB,CAAA"}
@@ -0,0 +1,5 @@
1
+ /** Recursively readonly observation of portable data; mutable wire DTOs remain unchanged. */
2
+ export type HistoireReadonly<T> = T extends (...arguments_: never[]) => unknown ? T : T extends object ? {
3
+ readonly [Key in keyof T]: HistoireReadonly<T[Key]>;
4
+ } : T;
5
+ //# sourceMappingURL=readonly.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"readonly.d.ts","sourceRoot":"","sources":["../../src/types/readonly.ts"],"names":[],"mappings":"AAAA,6FAA6F;AAC7F,MAAM,MAAM,gBAAgB,CAAC,CAAC,IAAI,CAAC,SAAS,CAAC,GAAG,UAAU,EAAE,KAAK,EAAE,KAAK,OAAO,GAC3E,CAAC,GACD,CAAC,SAAS,MAAM,GACd;IAAE,QAAQ,EAAE,GAAG,IAAI,MAAM,CAAC,GAAG,gBAAgB,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC;CAAE,GACvD,CAAC,CAAA"}
@@ -0,0 +1,31 @@
1
+ /** Existing preview settings, retained for shared/app compatibility. */
2
+ export interface PreviewSettings {
3
+ /** Logical viewport width in CSS pixels. */
4
+ responsiveWidth: number;
5
+ /** Optional logical viewport height in CSS pixels. */
6
+ responsiveHeight: number | null;
7
+ /** Rotate width/height when presenting viewport. */
8
+ rotate: boolean;
9
+ /** Preview background CSS color. */
10
+ backgroundColor: string;
11
+ /** Show transparent-background checkerboard. */
12
+ checkerboard: boolean;
13
+ /** Checkerboard palette; omitted legacy values use light. */
14
+ checkerboardTheme?: 'light' | 'dark';
15
+ /** Text direction in isolated story document. */
16
+ textDirection: 'ltr' | 'rtl';
17
+ }
18
+ /** Host-owned primitive globals delivered reactively to runtime. */
19
+ export type HistoireGlobals = Record<string, string | number | boolean | null>;
20
+ /** Complete session settings; never mutate host document preferences. */
21
+ export interface HistoireSettings extends PreviewSettings {
22
+ /** Explicit surface/runtime appearance. */
23
+ colorScheme: 'light' | 'dark' | 'auto';
24
+ /** Per-session theme/design-token globals. */
25
+ globals: HistoireGlobals;
26
+ }
27
+ /** Validated partial preferences update. */
28
+ export type HistoireSettingsPatch = Partial<HistoireSettings>;
29
+ /** Fresh defaults prevent globals shared between sessions. */
30
+ export declare function createDefaultHistoireSettings(): HistoireSettings;
31
+ //# sourceMappingURL=settings.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"settings.d.ts","sourceRoot":"","sources":["../../src/types/settings.ts"],"names":[],"mappings":"AAAA,wEAAwE;AACxE,MAAM,WAAW,eAAe;IAC9B,4CAA4C;IAC5C,eAAe,EAAE,MAAM,CAAA;IACvB,sDAAsD;IACtD,gBAAgB,EAAE,MAAM,GAAG,IAAI,CAAA;IAC/B,oDAAoD;IACpD,MAAM,EAAE,OAAO,CAAA;IACf,oCAAoC;IACpC,eAAe,EAAE,MAAM,CAAA;IACvB,gDAAgD;IAChD,YAAY,EAAE,OAAO,CAAA;IACrB,6DAA6D;IAC7D,iBAAiB,CAAC,EAAE,OAAO,GAAG,MAAM,CAAA;IACpC,iDAAiD;IACjD,aAAa,EAAE,KAAK,GAAG,KAAK,CAAA;CAC7B;AAED,oEAAoE;AACpE,MAAM,MAAM,eAAe,GAAG,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,GAAG,OAAO,GAAG,IAAI,CAAC,CAAA;AAE9E,yEAAyE;AACzE,MAAM,WAAW,gBAAiB,SAAQ,eAAe;IACvD,2CAA2C;IAC3C,WAAW,EAAE,OAAO,GAAG,MAAM,GAAG,MAAM,CAAA;IACtC,8CAA8C;IAC9C,OAAO,EAAE,eAAe,CAAA;CACzB;AAED,4CAA4C;AAC5C,MAAM,MAAM,qBAAqB,GAAG,OAAO,CAAC,gBAAgB,CAAC,CAAA;AAE7D,8DAA8D;AAC9D,wBAAgB,6BAA6B,IAAI,gBAAgB,CAEhE"}
@@ -0,0 +1,94 @@
1
+ import type { HistoireCatalog, HistoireDiagnostic } from './catalog.js';
2
+ import type { HistoireCapabilities, HistoireSourceIdentity, HistoireTarget } from './common.js';
3
+ import type { HistoireInspectionCapabilities } from './inspection.js';
4
+ import type { HistoireSettings } from './settings.js';
5
+ /** Session connection lifecycle. */
6
+ export type HistoireSessionStatus = 'idle' | 'connecting' | 'ready' | 'restarting' | 'disconnected' | 'failed' | 'disposed';
7
+ /** Authoritative cleaned state, never live callbacks or instances. */
8
+ export interface HistoireStateSnapshot {
9
+ /** Exact state owner. */
10
+ target: HistoireTarget;
11
+ /** Runtime document that produced value. */
12
+ runtimeId: string;
13
+ /** Structured-clone-safe cleaned projection; may contain cycles. */
14
+ value: Record<string, unknown> | unknown[];
15
+ }
16
+ /** Rendered CSS-pixel box within primary mount padding box. */
17
+ export interface HistoireRect {
18
+ /** Horizontal position. */
19
+ x: number;
20
+ /** Vertical position. */
21
+ y: number;
22
+ /** Complete width. */
23
+ width: number;
24
+ /** Complete height. */
25
+ height: number;
26
+ }
27
+ /** Ready visible variant geometry. */
28
+ export interface HistoireViewport extends HistoireRect {
29
+ /** Variant content owner. */
30
+ target: HistoireTarget;
31
+ /** Positive rendered-to-logical viewport scale. */
32
+ scale: number;
33
+ /** Content box intersected with source and host scroll clips. */
34
+ visibleRect: HistoireRect;
35
+ }
36
+ /** Canonical primary-runtime attachment. */
37
+ export interface HistoireRuntimeSnapshot {
38
+ /** Runtime readiness independent of source connection. */
39
+ status: 'absent' | 'mounting' | 'ready' | 'failed' | 'stale';
40
+ /** Owning surface attachment or null. */
41
+ mountId: string | null;
42
+ /** Current runtime document or null. */
43
+ runtimeId: string | null;
44
+ /** Ready visible variant boxes; hidden preview has none. */
45
+ viewports: readonly HistoireViewport[];
46
+ /** Selected visible entry, otherwise null. */
47
+ viewport: HistoireViewport | null;
48
+ /** Inspection supported by the current runtime actor; absence denies access. */
49
+ inspection?: HistoireInspectionCapabilities;
50
+ }
51
+ /** One cleaned event from exact runtime target. */
52
+ export interface HistoireEvent {
53
+ /** Monotonic session event sequence. */
54
+ sequence: number;
55
+ /** Source event timestamp. */
56
+ timestamp: number;
57
+ /** Exact event owner. */
58
+ target: HistoireTarget;
59
+ /** Runtime document owner. */
60
+ runtimeId: string;
61
+ /** Cleaned application payload. */
62
+ payload: unknown;
63
+ }
64
+ /** Stable read-only session projection published atomically. */
65
+ export interface HistoireSnapshot {
66
+ /** Source connection lifecycle. */
67
+ status: HistoireSessionStatus;
68
+ /** Retained data no longer known to be current. */
69
+ stale: boolean;
70
+ /** Connected book identity or null before handshake. */
71
+ source: HistoireSourceIdentity | null;
72
+ /** Last completed catalog, including empty catalog. */
73
+ catalog: HistoireCatalog;
74
+ /** Projected collection issues. */
75
+ diagnostics: readonly HistoireDiagnostic[];
76
+ /** Single session-selected target. */
77
+ selection: HistoireTarget | null;
78
+ /** Primary runtime attachment/readiness. */
79
+ runtime: HistoireRuntimeSnapshot;
80
+ /** Authoritative mirror or null before snapshot. */
81
+ state: HistoireStateSnapshot | null;
82
+ /** Current session preferences. */
83
+ settings: HistoireSettings;
84
+ /** Source capabilities filtered by selection/readiness. */
85
+ capabilities: HistoireCapabilities;
86
+ /** Effective inspection support; absence denies access. */
87
+ inspection?: HistoireInspectionCapabilities;
88
+ /** Latest 1,000 events and loss accounting. */
89
+ events: {
90
+ items: readonly HistoireEvent[];
91
+ droppedCount: number;
92
+ };
93
+ }
94
+ //# sourceMappingURL=snapshot.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"snapshot.d.ts","sourceRoot":"","sources":["../../src/types/snapshot.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,kBAAkB,EAAE,MAAM,cAAc,CAAA;AACvE,OAAO,KAAK,EAAE,oBAAoB,EAAE,sBAAsB,EAAE,cAAc,EAAE,MAAM,aAAa,CAAA;AAC/F,OAAO,KAAK,EAAE,8BAA8B,EA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IACjC,gFAAgF;IAChF,UAAU,CAAC,EAAE,8BAA8B,CAAA;CAC5C;AAED,mDAAmD;AACnD,MAAM,WAAW,aAAa;IAC5B,wCAAwC;IACxC,QAAQ,EAAE,MAAM,CAAA;IAChB,8BAA8B;IAC9B,SAAS,EAAE,MAAM,CAAA;IACjB,yBAAyB;IACzB,MAAM,EAAE,cAAc,CAAA;IACtB,8BAA8B;IAC9B,SAAS,EAAE,MAAM,CAAA;IACjB,mCAAmC;IACnC,OAAO,EAAE,OAAO,CAAA;CACjB;AAED,gEAAgE;AAChE,MAAM,WAAW,gBAAgB;IAC/B,mCAAmC;IACnC,MAAM,EAAE,qBAAqB,CAAA;IAC7B,mDAAmD;IACnD,KAAK,EAAE,OAAO,CAAA;IACd,wDAAwD;IACxD,MAAM,EAAE,sBAAsB,GAAG,IAAI,CAAA;IACrC,uDAAuD;IACvD,OAAO,EAAE,eAAe,CAAA;IACxB,mCAAmC;IACnC,WAAW,EAAE,SAAS,kBAAkB,EAAE,CAAA;IAC1C,sCAAsC;IACtC,SAAS,EAAE,cAAc,GAAG,IAAI,CAAA;IAChC,4CAA4C;IAC5C,OAAO,EAAE,uBAAuB,CAAA;IAChC,oDAAoD;IACpD,KAAK,EAAE,qBAAqB,GAAG,IAAI,CAAA;IACnC,mCAAmC;IACnC,QAAQ,EAAE,gBAAgB,CAAA;IAC1B,2DAA2D;IAC3D,YAAY,EAAE,oBAAoB,CAAA;IAClC,2DAA2D;IAC3D,UAAU,CAAC,EAAE,8BAA8B,CAAA;IAC3C,+CAA+C;IAC/C,MAAM,EAAE;QAAE,KAAK,EAAE,SAAS,aAAa,EAAE,CAAC;QAAC,YAAY,EAAE,MAAM,CAAA;KAAE,CAAA;CAClE"}
@@ -0,0 +1,72 @@
1
+ import type { HistoireSettings } from './settings.js';
2
+ /** Portable source appearance; executable config and filesystem paths excluded. */
3
+ export interface HistoireSourceConfig {
4
+ /** Source display title. */
5
+ title: string;
6
+ /** Full-book link routing; omitted older descriptors use history mode. */
7
+ routerMode?: 'history' | 'hash';
8
+ /** Portable props matrix defaults; absent on older sources. */
9
+ matrix?: {
10
+ /** Ordered samples for open numeric props. */
11
+ numericValues: readonly number[];
12
+ };
13
+ /** Named appearance values used by first-party surfaces. */
14
+ theme: {
15
+ /** Source preference used before host settings arrive. */
16
+ defaultColorScheme: HistoireSettings['colorScheme'];
17
+ /** Class applied only inside isolated runtime. */
18
+ darkClass: string;
19
+ /** Hide standalone appearance control when configured. */
20
+ hideColorSchemeSwitch?: boolean;
21
+ /** Serializable theme color tokens. */
22
+ colors?: Record<string, Record<string, string>>;
23
+ };
24
+ /** Named logical viewport sizes. */
25
+ responsivePresets: readonly {
26
+ label: string;
27
+ width: number;
28
+ height?: number | null;
29
+ }[];
30
+ /** Named backgrounds and corresponding text colors. */
31
+ backgroundPresets: readonly {
32
+ label: string;
33
+ color: string;
34
+ contrastColor?: string;
35
+ }[];
36
+ /** Whether runtime derives contrast from selected background. */
37
+ autoApplyContrastColor: boolean;
38
+ /** Existing preview story collection/readiness deadline in milliseconds. */
39
+ storyCollectTimeout?: number;
40
+ /** Existing source test execution budget in milliseconds. */
41
+ runTimeout?: number;
42
+ /** Maximum in-book test workers; projected from `test.maxWorkers`. */
43
+ testMaxWorkers?: number;
44
+ /** Source defaults for host-owned primitive globals. */
45
+ globals?: HistoireSettings['globals'];
46
+ /** Source initial preview/capture direction. */
47
+ textDirection?: HistoireSettings['textDirection'];
48
+ }
49
+ /** Exact parent-origin policy; source document origin is always allowed. */
50
+ export interface HistoireEmbedPolicy {
51
+ /** Additional exact HTTP(S) origins. */
52
+ allowedOrigins: readonly string[];
53
+ /** Explicit cross-origin editor permission. */
54
+ allowOpenInEditor: boolean;
55
+ /** Explicit cross-origin dev test permission. */
56
+ allowServerTests: boolean;
57
+ }
58
+ /** Opaque same-book content references, resolved only by source document. */
59
+ export interface HistoireSourceAssets {
60
+ /** Lazy search document containing structured targets. */
61
+ search: string;
62
+ /** Exact story content inventory, never arbitrary caller URLs. */
63
+ content: readonly {
64
+ /** Exact collected story identity. */
65
+ storyId: string;
66
+ /** Optional documentation asset. */
67
+ docs?: string;
68
+ /** Optional original registered source asset. */
69
+ rawSource?: string;
70
+ }[];
71
+ }
72
+ //# sourceMappingURL=source-descriptor.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"source-descriptor.d.ts","sourceRoot":"","sources":["../../src/types/source-descriptor.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,eAAe,CAAA;AAErD,mFAAmF;AACnF,MAAM,WAAW,oBAAoB;IACnC,4BAA4B;IAC5B,KAAK,EAAE,MAAM,CAAA;IACb,0EAA0E;IAC1E,UAAU,CAAC,EAAE,SAAS,GAAG,MAAM,CAAA;IAC/B,+DAA+D;IAC/D,MAAM,CAAC,EAAE;QACP,8CAA8C;QAC9C,aAAa,EAAE,SAAS,MAAM,EAAE,CAAA;KACjC,CAAA;IACD,4DAA4D;IAC5D,KAAK,EAAE;QACL,0DAA0D;QAC1D,kBAAkB,EAAE,gBAAgB,CAAC,aAAa,CAAC,CAAA;QACnD,kDAAkD;QAClD,SAAS,EAAE,MAAM,CAAA;QACjB,0DAA0D;QAC1D,qBAAqB,CAAC,EAAE,OAAO,CAAA;QAC/B,uCAAuC;QACvC,MAAM,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,CAAA;KAChD,CAAA;IACD,oCAAoC;IACpC,iBAAiB,EAAE,SAAS;QAAE,KAAK,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,MAAM,CAAC;QAAC,MAAM,CAAC,EAAE,MAAM,GAAG,IAAI,CAAA;KAAE,EAAE,CAAA;IACtF,uDAAuD;IACvD,iBAAiB,EAAE,SAAS;QAAE,KAAK,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,MAAM,CAAC;QAAC,aAAa,CAAC,EAAE,MAAM,CAAA;KAAE,EAAE,CAAA;IACtF,iEAAiE;IACjE,sBAAsB,EAAE,OAAO,CAAA;IAC/B,4EAA4E;IAC5E,mBAAmB,CAAC,EAAE,MAAM,CAAA;IAC5B,6DAA6D;IAC7D,UAAU,CAAC,EAAE,MAAM,CAAA;IACnB,sEAAsE;IACtE,cAAc,CAAC,EAAE,MAAM,CAAA;IACvB,wDAAwD;IACxD,OAAO,CAAC,EAAE,gBAAgB,CAAC,SAAS,CAAC,CAAA;IACrC,gDAAgD;IAChD,aAAa,CAAC,EAAE,gBAAgB,CAAC,eAAe,CAAC,CAAA;CAClD;AAED,4EAA4E;AAC5E,MAAM,WAAW,mBAAmB;IAClC,wCAAwC;IACxC,cAAc,EAAE,SAAS,MAAM,EAAE,CAAA;IACjC,+CAA+C;IAC/C,iBAAiB,EAAE,OAAO,CAAA;IAC1B,iDAAiD;IACjD,gBAAgB,EAAE,OAAO,CAAA;CAC1B;AAED,6EAA6E;AAC7E,MAAM,WAAW,oBAAoB;IACnC,0DAA0D;IAC1D,MAAM,EAAE,MAAM,CAAA;IACd,kEAAkE;IAClE,OAAO,EAAE,SAAS;QAChB,sCAAsC;QACtC,OAAO,EAAE,MAAM,CAAA;QACf,oCAAoC;QACpC,IAAI,CAAC,EAAE,MAAM,CAAA;QACb,iDAAiD;QACjD,SAAS,CAAC,EAAE,MAAM,CAAA;KACnB,EAAE,CAAA;CACJ"}
@@ -0,0 +1,20 @@
1
+ import type { HistoireTarget } from './common.js';
2
+ /** Portable structured search row; exact IDs never encoded with delimiters. */
3
+ export interface HistoireSourceSearchRow {
4
+ /** Activation target without runtime ownership. */
5
+ target: HistoireTarget;
6
+ /** Origin of searchable text. */
7
+ kind: 'story' | 'variant' | 'docs';
8
+ /** Display label returned to host. */
9
+ title: string;
10
+ /** Source-index text used by existing Fuse ranking. */
11
+ text: string;
12
+ }
13
+ /** Lazy source-owned title and documentation indexes. */
14
+ export interface HistoireSourceSearchData {
15
+ /** Story and variant title rows in source order. */
16
+ titles: readonly HistoireSourceSearchRow[];
17
+ /** Preferred documentation text without arbitrary source reads. */
18
+ docs: readonly HistoireSourceSearchRow[];
19
+ }
20
+ //# sourceMappingURL=source-search.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"source-search.d.ts","sourceRoot":"","sources":["../../src/types/source-search.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,aAAa,CAAA;AAEjD,+EAA+E;AAC/E,MAAM,WAAW,uBAAuB;IACtC,mDAAmD;IACnD,MAAM,EAAE,cAAc,CAAA;IACtB,iCAAiC;IACjC,IAAI,EAAE,OAAO,GAAG,SAAS,GAAG,MAAM,CAAA;IAClC,sCAAsC;IACtC,KAAK,EAAE,MAAM,CAAA;IACb,uDAAuD;IACvD,IAAI,EAAE,MAAM,CAAA;CACb;AAED,yDAAyD;AACzD,MAAM,WAAW,wBAAwB;IACvC,oDAAoD;IACpD,MAAM,EAAE,SAAS,uBAAuB,EAAE,CAAA;IAC1C,mEAAmE;IACnE,IAAI,EAAE,SAAS,uBAAuB,EAAE,CAAA;CACzC"}