@wenathlan/devthink 1.1.16 → 2.0.9

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 (160) hide show
  1. package/CHANGELOG.md +1374 -0
  2. package/README.md +6 -0
  3. package/bridge.d.ts +698 -0
  4. package/bridge.d.ts.map +1 -0
  5. package/bridge.js +1877 -0
  6. package/bun.d.ts +8 -0
  7. package/bun.d.ts.map +1 -0
  8. package/bun.js +52329 -0
  9. package/caps/background.json +712 -0
  10. package/caps/cli.json +360 -0
  11. package/caps/library.json +3611 -0
  12. package/caps/mcp.json +126 -0
  13. package/caps/pagebridge.json +377 -0
  14. package/caps/popup.json +51 -0
  15. package/caps/sidepanel.json +522 -0
  16. package/checksums.txt +142 -0
  17. package/cli.d.ts +187 -0
  18. package/cli.d.ts.map +1 -0
  19. package/cli.js +18197 -0
  20. package/companion.d.ts +19 -0
  21. package/companion.d.ts.map +1 -0
  22. package/companion.js +389 -0
  23. package/crossbrowser.d.ts +277 -0
  24. package/crossbrowser.d.ts.map +1 -0
  25. package/crossbrowser.js +1191 -0
  26. package/dashdone.d.ts +273 -0
  27. package/dashdone.d.ts.map +1 -0
  28. package/dashdone.js +368 -0
  29. package/deno.d.ts +11 -0
  30. package/deno.d.ts.map +1 -0
  31. package/deno.js +52325 -0
  32. package/devthink.umd.js +52346 -0
  33. package/fixtures/bun.ts +7 -0
  34. package/fixtures/cjs.js +6 -0
  35. package/fixtures/deno.ts +6 -0
  36. package/fixtures/example-org-pagestate.json +22 -0
  37. package/fixtures/importers/automa-workflow.json +18 -0
  38. package/fixtures/importers/selenium-side.json +20 -0
  39. package/fixtures/importers/tabular-plan.csv +7 -0
  40. package/fixtures/importers/uivision-macro.json +10 -0
  41. package/fixtures/importers/v1-plan.json +13 -0
  42. package/fixtures/mcp-client.mjs +14 -0
  43. package/fixtures/pages/checkout.html +192 -0
  44. package/fixtures/pages/dashboard.html +110 -0
  45. package/fixtures/pages/feed.html +113 -0
  46. package/fixtures/pages/product-grid.html +150 -0
  47. package/fixtures/plans/form-inventory-plan.json +11 -0
  48. package/fixtures/plans/release-notes-plan.json +11 -0
  49. package/fixtures/recipes/agentscompete.json +11 -0
  50. package/fixtures/recipes/agentsforms.json +11 -0
  51. package/fixtures/recipes/agentsmonitor.json +11 -0
  52. package/fixtures/recipes/agentsreview.json +29 -0
  53. package/fixtures/recipes/agentswarm.json +11 -0
  54. package/fixtures/recipes/fillcalendar.json +12 -0
  55. package/fixtures/recipes/fillcheckout.json +13 -0
  56. package/fixtures/recipes/filldependentdropdowns.json +12 -0
  57. package/fixtures/recipes/fillfromcsv.json +13 -0
  58. package/fixtures/recipes/fillloginform.json +12 -0
  59. package/fixtures/recipes/fillmultistepwizard.json +13 -0
  60. package/fixtures/recipes/fillregistration.json +12 -0
  61. package/fixtures/recipes/fillsearchfilters.json +12 -0
  62. package/fixtures/recipes/filltypeahead.json +11 -0
  63. package/fixtures/recipes/monitoralerts.json +12 -0
  64. package/fixtures/recipes/monitoravailability.json +11 -0
  65. package/fixtures/recipes/monitornetworkquiet.json +12 -0
  66. package/fixtures/recipes/monitorpagechanges.json +11 -0
  67. package/fixtures/recipes/monitorpricechange.json +11 -0
  68. package/fixtures/recipes/monitorschedule.json +12 -0
  69. package/fixtures/recipes/scrapedynamicprices.json +13 -0
  70. package/fixtures/recipes/scrapeimagegallery.json +12 -0
  71. package/fixtures/recipes/scrapeinfinitefeed.json +13 -0
  72. package/fixtures/recipes/scrapenestedlists.json +12 -0
  73. package/fixtures/recipes/scrapeproductgrid.json +12 -0
  74. package/fixtures/recipes/scrapereviews.json +12 -0
  75. package/fixtures/recipes/scrapesearchresults.json +12 -0
  76. package/fixtures/recipes/scrapetablepagination.json +12 -0
  77. package/fixtures/recipes/testaccessibility.json +34 -0
  78. package/fixtures/recipes/testconsoleerrors.json +12 -0
  79. package/fixtures/recipes/testdeeplinks.json +12 -0
  80. package/fixtures/recipes/testformvalidation.json +13 -0
  81. package/fixtures/recipes/testlayoutshift.json +12 -0
  82. package/fixtures/recipes/testlinkcheck.json +12 -0
  83. package/fixtures/recipes/testloadtiming.json +12 -0
  84. package/fixtures/recipes/testvisualdiff.json +12 -0
  85. package/fixtures/workflows/changelog-digest-workflow.json +13 -0
  86. package/fixtures/workflows/form-survey-workflow.json +13 -0
  87. package/gallery.json +706 -0
  88. package/hardening.d.ts +81 -0
  89. package/hardening.d.ts.map +1 -0
  90. package/hardening.js +188 -0
  91. package/headless.d.ts +114 -0
  92. package/headless.d.ts.map +1 -0
  93. package/headless.js +11522 -0
  94. package/http.d.ts +636 -0
  95. package/http.d.ts.map +1 -0
  96. package/http.js +2165 -0
  97. package/index.cjs +54682 -0
  98. package/index.d.ts +40 -0
  99. package/index.d.ts.map +1 -0
  100. package/index.js +52310 -0
  101. package/index.neutral.js +46343 -0
  102. package/manifest.json +199 -0
  103. package/mcp.d.ts +501 -0
  104. package/mcp.d.ts.map +1 -0
  105. package/mcp.js +20515 -0
  106. package/memory.d.ts +2397 -0
  107. package/memory.d.ts.map +1 -0
  108. package/memory.js +5782 -0
  109. package/nativehost.template.json +10 -0
  110. package/node.cjs +54686 -0
  111. package/node.d.ts +8 -0
  112. package/node.d.ts.map +1 -0
  113. package/pack.d.ts +211 -0
  114. package/pack.d.ts.map +1 -0
  115. package/pack.js +805 -0
  116. package/package.json +111 -51
  117. package/policy.d.ts +1854 -0
  118. package/policy.d.ts.map +1 -0
  119. package/policy.js +12580 -0
  120. package/progress.d.ts +390 -0
  121. package/progress.d.ts.map +1 -0
  122. package/progress.js +645 -0
  123. package/protocol.d.ts +2336 -0
  124. package/protocol.d.ts.map +1 -0
  125. package/protocol.js +8334 -0
  126. package/schemas/audit.schema.json +226 -0
  127. package/schemas/capability.schema.json +113 -0
  128. package/schemas/envelope.schema.json +162 -0
  129. package/schemas/memory.schema.json +51 -0
  130. package/schemas/observation.schema.json +113 -0
  131. package/schemas/plan.schema.json +208 -0
  132. package/schemas/progress.schema.json +126 -0
  133. package/schemas/proposal.schema.json +68 -0
  134. package/schemas/session.schema.json +82 -0
  135. package/schemas/tool.schema.json +94 -0
  136. package/server.d.ts +435 -0
  137. package/server.d.ts.map +1 -0
  138. package/server.js +28877 -0
  139. package/umd-example.html +18 -0
  140. package/umd.d.ts +6 -0
  141. package/umd.d.ts.map +1 -0
  142. package/build.ts +0 -41
  143. package/check-secrets.ts +0 -52
  144. package/compatibility.ts +0 -37
  145. package/config.ts +0 -246
  146. package/devthink.ts +0 -397
  147. package/identity.ts +0 -156
  148. package/ids.ts +0 -22
  149. package/memory.ts +0 -95
  150. package/modes.ts +0 -43
  151. package/plugin.ts +0 -68
  152. package/providers.ts +0 -179
  153. package/server.ts +0 -264
  154. package/session.ts +0 -155
  155. package/storage.ts +0 -82
  156. package/stream.ts +0 -130
  157. package/sync.ts +0 -27
  158. package/terminal-ui.tsx +0 -155
  159. package/ui.ts +0 -143
  160. package/workspace.ts +0 -20
@@ -0,0 +1,277 @@
1
+ /**
2
+ * The crossbrowser module of the 1.1.90 consolidation: every correlated variation of the firefox, safari and polyfill browser coverage logic interned in this one file, so the module family carries one surface without duplicate variations.
3
+ * The correlation is the browser coverage family: browserpolyfills probes the webextension namespace differences and promisifies the callback apis behind one polyfill surface with its flags, intersection and namespace mapping; firefoxprep adapts the chromium manifest to the firefox denylist, permission map, action map and split bundle rules; xpipack assembles the firefox xpi archive with its linter budget, central directory and end record; and safariskeleton emits the safari web extension project files with its popover, zip central directory and end record.
4
+ * No permission, denylist entry or archive layout is ever guessed: every mapping stays explicit per browser, and no packaging path ever bypasses the human review.
5
+ */
6
+ import type { webextensionbrowser } from "./types.js";
7
+ /**
8
+ * Browserpolyfills of the 1.1.86 browser coverage family.
9
+ * Every cross browser normalization of the webextension api the codebase touches lives in this one pure module: the namespace resolver that prefers the browser namespace when present and falls back to the chrome namespace, the callback to promise normalizer that wraps the callback style the older engines speak into the promise shape the reviewed vocabulary reads, the sidepanel polyfill that opens a popup window when the sidepanel api is missing and preserves the review gate layout inside it, the scripting polyfill that falls back to tabs execute script on older engines, the storage polyfill that keeps session tokens under the same keys on every browser, the tabs and windows polyfills that normalize query, create, update and bounds handling, the notifications and contextmenu polyfills that normalize options and item creation, the clipboard, downloads and runtime messaging polyfills that normalize envelopes and shapes, and the runtime geturl polyfill that normalizes the reviewed resource path across browsers. The module stays pure: the browser runtime reaches it through injected seams only, the feature flags default to the intersection set across browsers, the unsupported calls surface as structured errors with the retry hint none instead of a silent fallback, and no vendor endpoint and no download url ever appears here — one reviewed vocabulary speaks every webextension dialect through the polyfill layer.
10
+ * Example: `const polyfills = browserpolyfillof({ runtime: globalThis.chrome ?? globalThis.browser }); const url = polyfills.runtime.geturl("sidepanel.html"); await polyfills.storage.local.set({ key: "value" });`
11
+ */
12
+ /** The feature flag set the polyfill layer ships: the flags the sidepanel, scripting, storage, tabs, windows, notifications, downloads, contextmenu, clipboard and runtime messaging namespaces carry; the default set is the intersection across chromium, firefox and safari so a feature surface a single browser lacks stays off everywhere by default. */
13
+ export declare const browserpolyfillflags: string[];
14
+ /** The intersection default set the polyfill layer stamps: every flag the chromium, firefox and safari apimap rows carry; a single browser surface that lacks an api stays off everywhere by default. */
15
+ export declare function browserpolyfillintersection(): string[];
16
+ /** Resolves the browser namespace: the polyfill prefers the browser namespace when present (firefox and safari) and falls back to the chrome namespace (chromium); an absent runtime surfaces an undefined so the caller degrades to the structured error. */
17
+ export declare function browserpolyfillnamespace(input: {
18
+ runtime?: unknown;
19
+ }): {
20
+ namespace: Record<string, unknown> | undefined;
21
+ browser: webextensionbrowser;
22
+ };
23
+ /** Wraps one callback style webextension call into a promise: the polyfill reads the last argument when it is a function, resolves on the ok callback and rejects on the runtime error the engine reports. */
24
+ export declare function browserpolyfillpromisify<T>(input: {
25
+ call: (...args: unknown[]) => void;
26
+ args: unknown[];
27
+ }): Promise<T>;
28
+ /** Builds the polyfill layer for one runtime: the namespace the resolver picks, the per surface normalizers (sidepanel, scripting, storage, tabs, windows, notifications, downloads, contextmenu, clipboard, runtime) and the feature flags the layer carries; every surface degrades to the structured error on an unsupported browser instead of a silent fallback. */
29
+ export declare function browserpolyfillof(input: {
30
+ runtime?: unknown;
31
+ }): {
32
+ browser: webextensionbrowser;
33
+ sidepanel: {
34
+ open: (options?: {
35
+ path?: string;
36
+ }) => Promise<{
37
+ ok: boolean;
38
+ fallback: boolean;
39
+ reason?: string;
40
+ }>;
41
+ setoptions: (options: {
42
+ path?: string;
43
+ }) => {
44
+ ok: boolean;
45
+ reason?: string;
46
+ };
47
+ };
48
+ scripting: {
49
+ executescript: (input: {
50
+ tabid: number;
51
+ files?: string[];
52
+ func?: () => void;
53
+ }) => Promise<{
54
+ ok: boolean;
55
+ fallback: boolean;
56
+ reason?: string;
57
+ }>;
58
+ };
59
+ storage: {
60
+ local: {
61
+ get: <T = unknown>(key?: string | string[] | Record<string, unknown> | null) => Promise<Record<string, T>>;
62
+ set: (entries: Record<string, unknown>) => Promise<void>;
63
+ };
64
+ session: {
65
+ get: <T = unknown>(key?: string | string[] | Record<string, unknown> | null) => Promise<Record<string, T>>;
66
+ set: (entries: Record<string, unknown>) => Promise<void>;
67
+ };
68
+ };
69
+ tabs: {
70
+ query: (query: Record<string, unknown>) => Promise<Array<{
71
+ id: number;
72
+ url?: string;
73
+ title?: string;
74
+ active?: boolean;
75
+ }>>;
76
+ create: (properties: Record<string, unknown>) => Promise<{
77
+ id: number;
78
+ url?: string;
79
+ }>;
80
+ update: (tabid: number, properties: Record<string, unknown>) => Promise<{
81
+ id: number;
82
+ url?: string;
83
+ }>;
84
+ };
85
+ windows: {
86
+ create: (properties: Record<string, unknown>) => Promise<{
87
+ id: number;
88
+ }>;
89
+ update: (windowid: number, properties: Record<string, unknown>) => Promise<{
90
+ id: number;
91
+ }>;
92
+ };
93
+ notifications: {
94
+ create: (notificationid: string, options: Record<string, unknown>) => Promise<string>;
95
+ };
96
+ downloads: {
97
+ download: (options: Record<string, unknown>) => Promise<number>;
98
+ };
99
+ contextmenu: {
100
+ create: (properties: Record<string, unknown>) => Promise<string | number>;
101
+ };
102
+ clipboard: {
103
+ read: () => Promise<string>;
104
+ write: (text: string) => Promise<void>;
105
+ };
106
+ runtime: {
107
+ geturl: (path: string) => string;
108
+ sendmessage: (message: unknown) => Promise<unknown>;
109
+ connect: (...args: unknown[]) => unknown;
110
+ };
111
+ };
112
+ /** The structured error of one unsupported polyfill call: the family, the message, the retry hint and the time, so the caller maps the failure to its next action instead of a bare throw. */
113
+ export declare function browserpolyfillstructerrorof(input: {
114
+ family: string;
115
+ message: string;
116
+ browser: webextensionbrowser;
117
+ now: number;
118
+ }): {
119
+ family: string;
120
+ message: string;
121
+ retry: "none";
122
+ browser: webextensionbrowser;
123
+ at: number;
124
+ };
125
+ import type { browsermanifestsource, browsermanifestoverlay, browsermanifestadapted } from "./types.js";
126
+ /**
127
+ * Firefoxprep of the 1.1.86 browser coverage family.
128
+ * Every firefox manifest adaptation concern of the cross browser build lives in this one pure module: the manifest overlay the build layers on top of the source manifest (one source manifest with per browser overlays never a separate hand maintained manifest), the browser specific settings the overlay writes with the generated extension id the firefox mv3 build needs, the action key mapping to the firefox equivalents, the service worker to event page move the firefox mv3 background semantics require, the optional permission name rewriting where firefox differs, the empty host permissions the deny by default posture keeps on every browser, the background bundle split for the event page semantics, the deny list that stays in force across overlays and the web accessible resources firefox pattern syntax the overlay carries. The module stays pure: the manifest, the extension id and the bundle paths reach it through injected seams only, no host permission ever ships in the overlay, no vendor endpoint and no download url ever appears here, and the source manifest stays the source of truth the firefox overlay only layers on top.
129
+ * Example: `const overlay = firefoxprepoverlay({ extensionid: "devthink@wenathlan", backgroundscript: "background.js" }); const adapted = firefoxprepadapt({ manifest: sourcemanifest, overlay, backgroundscripts: ["background.js"] });`
130
+ */
131
+ /** The firefox permission deny list the overlay keeps in force: the source manifest forbids the debugger, cookies, webRequest, history, bookmarks, proxy and management permissions, and the overlay refuses them across the firefox manifest too — the deny list never widens on firefox. */
132
+ export declare const firefoxdenylist: string[];
133
+ /** The firefox optional permission name map: the source manifest declares the chromium names, and the overlay rewrites the names that differ between chromium and firefox; the names that stay identical pass through untouched. */
134
+ export declare function firefoxpermissionmap(): Record<string, string>;
135
+ /** Builds the firefox overlay: the browser specific settings with the generated extension id, the strict min version, the action key mapping, the event page background scripts, the optional permission names that differ, the empty host permissions the deny by default posture keeps, and the web accessible resources pattern syntax firefox speaks. */
136
+ export declare function firefoxprepoverlay(input: {
137
+ extensionid?: string;
138
+ strictminversion?: string;
139
+ backgroundscript?: string;
140
+ sidepanel?: boolean;
141
+ }): browsermanifestoverlay;
142
+ /** Adapts the source manifest for firefox: the overlay layers on top, the background service worker moves to the event page scripts, the action key maps to the firefox equivalents, the optional permission names rewrite where they differ, the host permissions stay empty on every browser, the deny list stays in force across overlays, and the web accessible resources map to the firefox pattern syntax. */
143
+ export declare function firefoxprepadapt(input: {
144
+ manifest: browsermanifestsource;
145
+ overlay: browsermanifestoverlay;
146
+ backgroundscripts: string[];
147
+ }): browsermanifestadapted;
148
+ /** Splits the background bundle for the event page semantics: firefox loads the background as an event page script, so the bundle the chromium build ships as background.js stays the entry, the split keeps the service worker bundle as the firefox background script, and the polyfill layer wraps the namespace differences at runtime. */
149
+ export declare function firefoxprepsplitbundle(input: {
150
+ backgroundscript: string;
151
+ }): {
152
+ scripts: string[];
153
+ serviceworkerdropped: boolean;
154
+ };
155
+ /** Verifies the deny list stays in force across the overlay: a forbidden permission the overlay widens into the required set fails the build before the firefox manifest ships. */
156
+ export declare function firefoxprepdenylistcheck(input: {
157
+ manifest: browsermanifestsource;
158
+ }): {
159
+ ok: boolean;
160
+ refused: string[];
161
+ };
162
+ /** Maps the action key to the firefox equivalent: the firefox mv3 action key accepts the default_popup, default_title and default_icon shapes the chromium action key already carries; the overlay rewrites the default_popup path the firefox manifest expects. */
163
+ export declare function firefoxactionmap(): Record<string, string>;
164
+ import type { xpipackinput, xpipackoutput } from "./types.js";
165
+ /**
166
+ * Xpipack of the 1.1.86 browser coverage family.
167
+ * Every firefox build packaging concern of the cross browser packaging lives in this one pure module: the zip archive the build assembles from the firefox adapted manifest and the hashed dist bundles, the manifest placement at the archive root the firefox addons linter requires, the artifact name the release version stamps, the hashed asset names the immutable cache contract demands, the addons linter markers the build asserts (errors zero, warnings tolerated), and the entries list the build records for the checksum step. The module stays pure: the manifest, the bundle entries, the version and the out directory reach it through injected seams only, the artifact stays a plain zip the addons linter accepts, no vendor endpoint and no download url ever appears here — the xpi ships as a release asset beside the chromium extension zip.
168
+ * Example: `const output = xpipackassemble({ manifest: firefoxmanifest, bundleentries: [{ name: "background.js", bytes: buffer }], version: "1.1.86" });`
169
+ */
170
+ /** The minimum firefox addons linter markers the build asserts: errors zero, warnings tolerated inside the budget the user chose; the build never ships an xpi the linter refuses. */
171
+ export declare const xpilinterbudget: {
172
+ errors: number;
173
+ warnings: number;
174
+ };
175
+ /** The artifact name the release version stamps: the xpi carries the devthink-<version>.xpi shape the firefox addons store expects and the release workflow attaches beside the chromium zip. */
176
+ export declare function xpinameof(version: string): string;
177
+ /** The manifest placement the firefox addons linter requires: the manifest.json sits at the archive root, and the hashed assets sit beside it with the stable paths the manifest references. */
178
+ export declare function xpimanifestname(): string;
179
+ /** Assembles the firefox build into a zip ready for signing: the manifest sits at the archive root, the hashed assets sit beside it, the artifact name carries the release version, and the addons linter markers the build asserts stay inside the budget; the assemble stays pure and reads the bundle entries the build emits. Every offset, size and count the zip structure carries mirrors the entry the archive wrote, so the standard unzip tooling and the addons linter read the archive without a repair pass. */
180
+ export declare function xpipackassemble(input: xpipackinput): xpipackoutput;
181
+ /** Builds one local file header of the zip archive: the signature, the version, the flags, the compression method (stored), the file name and the bytes the entry carries; the xpipack stores every entry uncompressed because the firefox addons linter reads the manifest and the bundles without a deflate step. */
182
+ export declare function xpimanifestheader(name: string, bytes: Buffer): Buffer;
183
+ /** Builds the central directory of the zip archive: one entry per archive file with its name, its stored size and the true offset its local file header sits at — the offsets and sizes the unzip tooling and the addons linter read, so a record that drifts from the written bytes fails the reader instead of confusing it. */
184
+ export declare function xpicentraldirectory(records: Array<{
185
+ name: string;
186
+ size: number;
187
+ offset: number;
188
+ }>): {
189
+ bytes: Buffer;
190
+ offsets: number[];
191
+ };
192
+ /** Builds the end of central directory record the zip archive carries: the entry count, the central directory size and the true offset the central directory sits at — the offset the standard unzip tooling seeks before it lists one entry. */
193
+ export declare function xpiendrecord(entrycount: number, centralsize: number, centralstart: number): Buffer;
194
+ /** Asserts the addons linter markers the build asserts: the errors stay zero and the warnings stay under the budget the user chose; an xpi the linter refuses fails the build before it ships. */
195
+ export declare function xpipacklintercheck(input: {
196
+ markers: {
197
+ errors: number;
198
+ warnings: number;
199
+ };
200
+ budget: {
201
+ errors: number;
202
+ warnings: number;
203
+ };
204
+ }): {
205
+ ok: boolean;
206
+ reason?: string;
207
+ };
208
+ /** Lists the entries the xpipack archive carries: the manifest, the background bundle, the page bundles and the hashed assets the build records for the checksum step. */
209
+ export declare function xpipackentriesof(output: xpipackoutput): string[];
210
+ import type { safariskeletoninput, safariskeletonoutput } from "./types.js";
211
+ /**
212
+ * Safariskeleton of the 1.1.86 browser coverage family.
213
+ * Every safari app extension wrapper concern of the cross browser packaging lives in this one pure module: the xcode project wrapper the build generates around the chromium extension payload, the embedding of the chromium build as the safari web extension payload, the app entitlements the wrapper declares for the extension distribution, the minimal app shell that opens the extension, and the sidepanel surface the safari build renders as a popover equivalent. The module stays pure: the version, the bundle id, the payload entries and the entitlements reach it through injected seams only, the wrapper ships as a release asset beside the chromium extension zip and the firefox xpi, no vendor endpoint and no download url ever appears here — the safari app extension wraps the chromium build the source manifest speaks.
214
+ * Example: `const output = safariskeletonbuild({ version: "1.1.86", bundleid: "com.wenathlan.devthink", extensionpayload: [{ name: "manifest.json", bytes: buffer }], entitlements: ["com.apple.security.app-sandbox"] });`
215
+ */
216
+ /** The minimal xcode project wrapper the build generates around the chromium extension payload: the project file, the app target, the app extension target, the resources copy phase and the embedded app extension. */
217
+ export declare function safariskeletonprojectfiles(): Array<{
218
+ path: string;
219
+ text: string;
220
+ }>;
221
+ /** Builds the safari app extension wrapper around the chromium extension payload: the project files, the entitlements, the minimal app shell and the archive bytes the release workflow attaches beside the chromium zip and the firefox xpi. */
222
+ export declare function safariskeletonbuild(input: safariskeletoninput): safariskeletonoutput;
223
+ /** The popover equivalent the safari build renders for the sidepanel surface: the safari app extension opens a popover with the same review gate layout the sidepanel polyfill carries on the chromium build. */
224
+ export declare function safariskeletonpopoverof(): {
225
+ path: string;
226
+ bounds: {
227
+ width: number;
228
+ height: number;
229
+ };
230
+ };
231
+ /** Builds one local file header of the safari skeleton zip archive (stored, no compression) for the wrapper files and the embedded chromium payload. */
232
+ export declare function safarizipfile(name: string, bytes: Buffer): Buffer;
233
+ /** Builds the central directory of the safari skeleton zip archive: one entry per archive file with its name, its stored size and the true offset its local file header sits at, so the standard unzip tooling lists the wrapper without a repair pass. */
234
+ export declare function safaricentraldirectory(records: Array<{
235
+ name: string;
236
+ size: number;
237
+ offset: number;
238
+ }>): {
239
+ bytes: Buffer;
240
+ };
241
+ /** Builds the end of central directory record the safari skeleton zip archive carries: the entry count, the central directory size and the true offset the central directory sits at, so the standard unzip tooling seeks the directory before it lists one entry. */
242
+ export declare function safariendrecord(entrycount: number, centralsize: number, centralstart: number): Buffer;
243
+ import type { apibrowserprobeinput, apimapbrowserprobe, apimapreport, apimapresolution, apimapstructerror, webextensionapientry, webextensionapikind } from "./types.js";
244
+ /**
245
+ * Apimap of the 1.1.86 browser coverage family.
246
+ * Every webextension api concern of the cross browser build lives in this one pure module: the catalog of every webextension api the codebase touches, the per browser equivalents (chromium, firefox and safari) of every api, the runtime browser probe that resolves the right call for the running browser, the in memory cache that holds the resolved browser for the run, the structured errors that surface the unsupported calls with their retry hints and the build time unmapped api report that fails the build when a new api lacks a row. The module stays pure: the browser runtime object, the user agent and the install probe reach it through injected seams only, the kind catalog and the policy gates stay identical on every browser, no vendor endpoint and no download url ever appears here — a single source manifest speaks every webextension dialect through the per browser overlay it carries, and an unsupported call surfaces a structured error instead of a silent fallback.
247
+ * Example: `const probe = apimapbrowsercacheprobe({ runtime: globalThis.chrome, probeuseragent: () => navigator.userAgent }); const browser = probe(); const api = apimapresolve("storage.local", browser); const unmapped = apimapunmapped(apimapentries());`
248
+ */
249
+ /** The kind of every recorded webextension api: a namespace the codebase reads, a method it calls, an event it listens to, or a property it queries. */
250
+ export declare function apimapkinds(): webextensionapikind[];
251
+ /** The catalog of every webextension api the codebase touches: the api name the reviewed vocabulary uses, the per browser equivalent (chromium, firefox and safari), the kind and the unsupported marker that flags an api a single browser lacks. A new api without a chromium and firefox mapping fails the build before it ships; the catalog is the source of truth the apimap build check reads. */
252
+ export declare function apimapentries(): webextensionapientry[];
253
+ /** The default feature flag set: every feature flag that ships crosses every browser through the intersection of the per browser sets. */
254
+ export declare function apifeatureflagintersection(): string[];
255
+ /** Looks up one apimap entry by its reviewed api name; a missing entry returns undefined so the resolver and the unmapped reporter read the same shape. */
256
+ export declare function apimapentryof(api: string): webextensionapientry | undefined;
257
+ /** Resolves one reviewed api to the per browser call of the running browser; the runtime probe runs first when the caller passes the runtime seam, the empty probe answers the browser the caller chose, and an unmapped api surfaces an unsupported structured error with the retry hint instead of a silent fallback. */
258
+ export declare function apimapresolve(input: {
259
+ api: string;
260
+ browser?: webextensionbrowser;
261
+ runtime?: unknown;
262
+ probeuseragent?: () => string;
263
+ }): apimapresolution;
264
+ /** Reports the unmapped apis of the catalog at build time: an api without a chromium and firefox mapping fails the build before it ships, and the report keeps the per browser coverage of every api beside the missing rows. */
265
+ export declare function apimapunmapped(entries?: webextensionapientry[]): apimapreport;
266
+ /** The runtime browser probe resolves the running browser from the runtime seam and the user agent: the chromium runtime carries the chrome namespace, the firefox runtime carries the browser namespace, the safari runtime carries the browser namespace beside a vendor keyword in the user agent the probe reads, and an unknown runtime degrades to chromium so the source manifest stays the default the cross browser build loads. */
267
+ export declare function apimapbrowserof(input?: apibrowserprobeinput): webextensionbrowser;
268
+ /** Builds the in memory cached browser probe: the probe resolves the browser once per run, the cache holds it for the rest of the run, and a forced refresh rewrites the cache when the build runs the same process over a new context. */
269
+ export declare function apimapbrowsercacheprobe(input?: apibrowserprobeinput): apimapbrowserprobe;
270
+ /** The structured error of an unsupported apimap call: the family, the message, the retry hint and the time, so a caller maps the failure to its next action instead of a bare throw. */
271
+ export declare function apimapstructerrorof(input: {
272
+ api: string;
273
+ browser: webextensionbrowser;
274
+ reason?: string;
275
+ now: number;
276
+ }): apimapstructerror;
277
+ //# sourceMappingURL=crossbrowser.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"crossbrowser.d.ts","sourceRoot":"","sources":["../crossbrowser.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAGH,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,YAAY,CAAC;AAEtD;;;;GAIG;AAEH,+VAA+V;AAC/V,eAAO,MAAM,oBAAoB,EAAE,MAAM,EAWxC,CAAC;AAEF,yMAAyM;AACzM,wBAAgB,2BAA2B,IAAI,MAAM,EAAE,CA2BtD;AAED,8PAA8P;AAC9P,wBAAgB,wBAAwB,CAAC,KAAK,EAAE;IAAE,OAAO,CAAC,EAAE,OAAO,CAAA;CAAE,GAAG;IACtE,SAAS,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,SAAS,CAAC;IAC/C,OAAO,EAAE,mBAAmB,CAAC;CAC9B,CAYA;AAED,8MAA8M;AAC9M,wBAAgB,wBAAwB,CAAC,CAAC,EAAE,KAAK,EAAE;IACjD,IAAI,EAAE,CAAC,GAAG,IAAI,EAAE,OAAO,EAAE,KAAK,IAAI,CAAC;IACnC,IAAI,EAAE,OAAO,EAAE,CAAC;CACjB,GAAG,OAAO,CAAC,CAAC,CAAC,CAqBb;AAED,yWAAyW;AACzW,wBAAgB,iBAAiB,CAAC,KAAK,EAAE;IAAE,OAAO,CAAC,EAAE,OAAO,CAAA;CAAE;;;yBAkCnC;YAAE,IAAI,CAAC,EAAE,MAAM,CAAA;SAAE,K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