@terminals-tech/sdk 1.0.0-rc.1 → 1.0.0

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 (82) hide show
  1. package/README.md +15 -19
  2. package/dist/WebContainerManager-4LIOGRVM.js +22 -0
  3. package/dist/browser-http-client-ZQLDWZMU.js +317 -0
  4. package/dist/cache-VKYSQRXX.js +45 -0
  5. package/dist/capabilities-MIPUMBLL.js +96 -0
  6. package/dist/chunk-2ESYSVXG.js +48 -0
  7. package/dist/chunk-2WTYE4SW.js +190 -0
  8. package/dist/chunk-3LFMIVJM.js +40 -0
  9. package/dist/chunk-ABCK4FWN.js +136 -0
  10. package/dist/chunk-AFDUOYHD.js +2060 -0
  11. package/dist/chunk-BCOQMFKT.js +265 -0
  12. package/dist/chunk-BYXBJQAS.js +0 -0
  13. package/dist/chunk-DKFJIILR.js +9798 -0
  14. package/dist/chunk-EXI3LJVJ.js +51 -0
  15. package/dist/chunk-FOXUEYWK.js +42 -0
  16. package/dist/chunk-GJWAJAX3.js +173 -0
  17. package/dist/chunk-H3POJCFA.js +333 -0
  18. package/dist/chunk-KASHT6C5.js +784 -0
  19. package/dist/chunk-KHR7ZYCX.js +4034 -0
  20. package/dist/chunk-L45BSQDJ.js +296 -0
  21. package/dist/chunk-LLGZTP3G.js +5521 -0
  22. package/dist/chunk-NTMBOESX.js +152 -0
  23. package/dist/chunk-OCLSAUCD.js +474 -0
  24. package/dist/chunk-OSSRZOGC.js +190 -0
  25. package/dist/chunk-PPFTKJDB.js +497 -0
  26. package/dist/chunk-PWAHFID5.js +381 -0
  27. package/dist/chunk-Q2VI6ICE.js +188 -0
  28. package/dist/chunk-QJFKEQHF.js +6460 -0
  29. package/dist/chunk-QWXPVB2L.js +320 -0
  30. package/dist/chunk-QWZRZKLZ.js +896 -0
  31. package/dist/chunk-STMI72WH.js +1005 -0
  32. package/dist/chunk-TSQ3BGLA.js +11945 -0
  33. package/dist/chunk-UJDUQNE2.js +79 -0
  34. package/dist/chunk-VZA2NUH3.js +118 -0
  35. package/dist/chunk-WGBCRNMB.js +1817 -0
  36. package/dist/chunk-WU4OTGJE.js +752 -0
  37. package/dist/chunk-XPJ63Y6T.js +70 -0
  38. package/dist/chunk-Y2EULKA2.js +172 -0
  39. package/dist/chunk-YJEZWCYV.js +94 -0
  40. package/dist/chunk-ZVO47SQV.js +150 -0
  41. package/dist/container-lite-QD3CRLS4.js +327 -0
  42. package/dist/core-H2UUDATO.js +146 -0
  43. package/dist/crypto-D4LMI2RN.js +45 -0
  44. package/dist/db-BWC2GGBN.js +50 -0
  45. package/dist/demo-T655Z5S4.js +87 -0
  46. package/dist/diagnostics-6RQTBR6I.js +113 -0
  47. package/dist/dist-OPDCWARF.js +727 -0
  48. package/dist/dist-VXJEKX3T.js +2441 -0
  49. package/dist/dist-VYGJXGUS.js +1008 -0
  50. package/dist/embeddings-7QXTXUMC.js +15 -0
  51. package/dist/embeddings-MAEWWUHW.js +9 -0
  52. package/dist/graph-RKMNE2X5.js +36 -0
  53. package/dist/hvm-CBEP3M4F.js +126 -0
  54. package/dist/index.cjs +49874 -8001
  55. package/dist/index.d.cts +1629 -1363
  56. package/dist/index.d.ts +1629 -1363
  57. package/dist/index.js +2462 -8130
  58. package/dist/mcp-NK34ZNM5.js +101 -0
  59. package/dist/mcp-client-service-browser-SGB2K3VZ.js +14 -0
  60. package/dist/neuro-state-XHRGIRVO.js +498 -0
  61. package/dist/nodes-K6GKI2FM.js +364 -0
  62. package/dist/package-EXUIU2RL.js +93 -0
  63. package/dist/package-VGL7HYTO.js +106 -0
  64. package/dist/package-XHMLOAQ4.js +98 -0
  65. package/dist/pg-events-QJAM2HIP.js +15 -0
  66. package/dist/pglite-adapter-43IOUBMV.js +50 -0
  67. package/dist/pgliteService-IUGNNOVU.js +258 -0
  68. package/dist/policy-IRJCM6FS.js +13 -0
  69. package/dist/registry-5WTDYQVQ.js +26 -0
  70. package/dist/registry-FW63E7FE.js +16 -0
  71. package/dist/registry-ZQ2IBLF6.js +9 -0
  72. package/dist/resolver-ALOJSOK5.js +24 -0
  73. package/dist/scheduler-B5CEYKWT.js +127 -0
  74. package/dist/secret-store-H7273UIT.js +18 -0
  75. package/dist/server-VW6DYDLH.js +18 -0
  76. package/dist/skills-VN7IN7SJ.js +6375 -0
  77. package/dist/stack-4KWCQQP7.js +103 -0
  78. package/dist/storage-L7MWNSPG.js +13 -0
  79. package/dist/supabaseService-6AYP2VY3.js +476 -0
  80. package/dist/topology-CIWWNVAN.js +13 -0
  81. package/dist/webcontainer-XWCE56F3.js +281 -0
  82. package/package.json +9 -3
@@ -0,0 +1,113 @@
1
+ import "./chunk-2ESYSVXG.js";
2
+
3
+ // ../../lib/webcontainer/diagnostics.ts
4
+ var WebContainerDiagnostics = class {
5
+ /**
6
+ * Run comprehensive diagnostics
7
+ */
8
+ static async run() {
9
+ const diagnostics = {
10
+ timestamp: Date.now(),
11
+ browserInfo: {
12
+ userAgent: navigator.userAgent,
13
+ platform: navigator.platform,
14
+ vendor: navigator.vendor
15
+ },
16
+ isolation: {
17
+ isSecureContext: window.isSecureContext,
18
+ crossOriginIsolated: window.crossOriginIsolated,
19
+ hasSharedArrayBuffer: typeof SharedArrayBuffer !== "undefined",
20
+ hasWebAssembly: typeof WebAssembly !== "undefined"
21
+ },
22
+ headers: {},
23
+ recommendations: []
24
+ };
25
+ try {
26
+ const response = await fetch(window.location.href, { method: "HEAD" });
27
+ diagnostics.headers = {
28
+ coop: response.headers.get("cross-origin-opener-policy") || void 0,
29
+ coep: response.headers.get("cross-origin-embedder-policy") || void 0,
30
+ corp: response.headers.get("cross-origin-resource-policy") || void 0
31
+ };
32
+ } catch (error) {
33
+ console.warn("[Diagnostics] Unable to fetch headers:", error);
34
+ }
35
+ diagnostics.recommendations = this.generateRecommendations(diagnostics);
36
+ return diagnostics;
37
+ }
38
+ /**
39
+ * Generate actionable recommendations based on diagnostics
40
+ */
41
+ static generateRecommendations(diag) {
42
+ const recommendations = [];
43
+ if (!diag.isolation.isSecureContext) {
44
+ recommendations.push("\u26A0\uFE0F Not in secure context - HTTPS required");
45
+ }
46
+ if (!diag.isolation.crossOriginIsolated) {
47
+ if (!diag.headers.coop || diag.headers.coop !== "same-origin") {
48
+ recommendations.push(
49
+ '\u274C COOP header missing or incorrect - should be "same-origin" for WebContainer routes'
50
+ );
51
+ }
52
+ if (!diag.headers.coep || !["credentialless", "require-corp"].includes(diag.headers.coep)) {
53
+ recommendations.push(
54
+ '\u274C COEP header missing or incorrect - should be "credentialless" or "require-corp"'
55
+ );
56
+ }
57
+ if (!diag.headers.coop && !diag.headers.coep) {
58
+ recommendations.push(
59
+ "\u{1F527} Check browser extensions that may modify headers (e.g., ModHeader, CORS Unblock)"
60
+ );
61
+ recommendations.push("\u{1F527} Verify middleware.ts is serving correct headers for this route");
62
+ }
63
+ }
64
+ if (!diag.isolation.hasSharedArrayBuffer) {
65
+ recommendations.push(
66
+ "\u274C SharedArrayBuffer not available - browser too old or headers incorrect"
67
+ );
68
+ recommendations.push("\u{1F527} Update browser: Chrome 96+, Firefox 95+, Safari 15.2+ required");
69
+ }
70
+ if (!diag.isolation.hasWebAssembly) {
71
+ recommendations.push("\u274C WebAssembly not supported - update browser");
72
+ }
73
+ if (recommendations.length === 0) {
74
+ recommendations.push("\u2705 All checks passed - WebContainer should work properly");
75
+ }
76
+ return recommendations;
77
+ }
78
+ /**
79
+ * Log diagnostics to console with formatting
80
+ */
81
+ static async logToConsole() {
82
+ const diag = await this.run();
83
+ console.group("\u{1F50D} WebContainer Cross-Origin Isolation Diagnostics");
84
+ console.log("Timestamp:", new Date(diag.timestamp).toISOString());
85
+ console.group("Browser Info");
86
+ console.table(diag.browserInfo);
87
+ console.groupEnd();
88
+ console.group("Cross-Origin Isolation Status");
89
+ console.table(diag.isolation);
90
+ console.groupEnd();
91
+ console.group("Response Headers");
92
+ console.table(diag.headers);
93
+ console.groupEnd();
94
+ console.group("Recommendations");
95
+ diag.recommendations.forEach((rec) => console.log(rec));
96
+ console.groupEnd();
97
+ console.groupEnd();
98
+ }
99
+ /**
100
+ * Export diagnostics as JSON for bug reports
101
+ */
102
+ static async exportJSON() {
103
+ const diag = await this.run();
104
+ return JSON.stringify(diag, null, 2);
105
+ }
106
+ };
107
+ if (typeof window !== "undefined") {
108
+ window.wcDiagnostics = WebContainerDiagnostics;
109
+ console.log("[WebContainer] Diagnostics available: window.wcDiagnostics.logToConsole()");
110
+ }
111
+ export {
112
+ WebContainerDiagnostics
113
+ };