@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,15 @@
1
+ import {
2
+ DEFAULT_EMBEDDING_DIM,
3
+ DEFAULT_EMBEDDING_MODEL,
4
+ embedText,
5
+ getEmbeddingDimension,
6
+ prewarmEmbeddingsWorker
7
+ } from "./chunk-ZVO47SQV.js";
8
+ import "./chunk-2ESYSVXG.js";
9
+ export {
10
+ DEFAULT_EMBEDDING_DIM,
11
+ DEFAULT_EMBEDDING_MODEL,
12
+ embedText,
13
+ getEmbeddingDimension,
14
+ prewarmEmbeddingsWorker
15
+ };
@@ -0,0 +1,9 @@
1
+ import {
2
+ encodePoints,
3
+ encodeTextBatch
4
+ } from "./chunk-XPJ63Y6T.js";
5
+ import "./chunk-2ESYSVXG.js";
6
+ export {
7
+ encodePoints,
8
+ encodeTextBatch
9
+ };
@@ -0,0 +1,36 @@
1
+ import "./chunk-2ESYSVXG.js";
2
+
3
+ // ../../lib/terminals-tech/machines/core/adapters/graph.ts
4
+ async function graphLib() {
5
+ return await import("./dist-VYGJXGUS.js");
6
+ }
7
+ function entityGraph() {
8
+ const nodes = /* @__PURE__ */ new Set();
9
+ const edges = [];
10
+ return {
11
+ async handle(input) {
12
+ const g = await graphLib().catch(() => null);
13
+ if (Array.isArray(input?.upsert)) {
14
+ for (const e of input.upsert) {
15
+ nodes.add(String(e.from));
16
+ nodes.add(String(e.to));
17
+ edges.push({ ...e, t: e.t || Date.now() });
18
+ }
19
+ }
20
+ if (input?.query) {
21
+ const { sinceMs, type } = input.query;
22
+ let res = edges;
23
+ if (sinceMs) {
24
+ const since = Date.now() - Number(sinceMs);
25
+ res = res.filter((e) => (e.t || 0) >= since);
26
+ }
27
+ if (type) res = res.filter((e) => e.type === type);
28
+ return { nodes: Array.from(nodes), edges: res };
29
+ }
30
+ return { nodeCount: nodes.size, edgeCount: edges.length };
31
+ }
32
+ };
33
+ }
34
+ export {
35
+ entityGraph
36
+ };
@@ -0,0 +1,126 @@
1
+ import "./chunk-2ESYSVXG.js";
2
+
3
+ // ../../lib/terminals-tech/machines/core/runners/hvm-simulator.ts
4
+ function runFibonacciLogic(n) {
5
+ if (n < 0) return 0;
6
+ if (n === 0) return 0;
7
+ if (n === 1) return 1;
8
+ return runFibonacciLogic(n - 1) + runFibonacciLogic(n - 2);
9
+ }
10
+ async function runInHVMSimulator(programName, input) {
11
+ console.log(`[HVM-Sim] Running ${programName} in simulator mode...`);
12
+ if (programName.includes("agent-logic")) {
13
+ const n = typeof input.n === "number" ? input.n : 15;
14
+ const startTime = performance.now();
15
+ const result = runFibonacciLogic(n);
16
+ const endTime = performance.now();
17
+ console.log(`[HVM-Sim] Completed in ${(endTime - startTime).toFixed(2)}ms. Result: ${result}`);
18
+ return result;
19
+ }
20
+ throw new Error(`[HVM-Sim] Unknown program: ${programName}`);
21
+ }
22
+
23
+ // ../../lib/terminals-tech/machines/core/runners/hvm.ts
24
+ async function runInHVM(manifest, input, ctx) {
25
+ const entry = manifest.entrypoints["wasm-hvm"];
26
+ if (!entry) {
27
+ return {
28
+ error: "No wasm-hvm entrypoint defined",
29
+ input
30
+ };
31
+ }
32
+ try {
33
+ const startTime = performance.now();
34
+ let result;
35
+ let strategy = "unknown";
36
+ if (entry.module.endsWith(".wasm")) {
37
+ try {
38
+ result = await runViaWasm(entry.module, input);
39
+ strategy = "wasm";
40
+ } catch (wasmError) {
41
+ console.warn(`[HVM] WASM execution failed, trying fallback:`, wasmError);
42
+ result = await runInHVMSimulator(entry.module, input);
43
+ strategy = "simulator-fallback";
44
+ }
45
+ } else if (entry.module.endsWith(".hvm")) {
46
+ try {
47
+ result = await runViaHVMCore(entry.module, input);
48
+ strategy = "hvm-core";
49
+ } catch (hvmError) {
50
+ console.warn(
51
+ `[HVM] CLI execution failed (likely missing binary), falling back to Simulator:`,
52
+ hvmError
53
+ );
54
+ result = await runInHVMSimulator(entry.module, input);
55
+ strategy = "simulator-fallback";
56
+ }
57
+ } else {
58
+ throw new Error(`Unsupported HVM module format: ${entry.module}`);
59
+ }
60
+ const endTime = performance.now();
61
+ return {
62
+ ...input,
63
+ result,
64
+ _hvm: {
65
+ reduced: true,
66
+ durationMs: endTime - startTime,
67
+ tier: "wasm-hvm",
68
+ strategy
69
+ }
70
+ };
71
+ } catch (error) {
72
+ return {
73
+ error: error.message,
74
+ input,
75
+ _hvm: {
76
+ reduced: false,
77
+ tier: "wasm-hvm"
78
+ }
79
+ };
80
+ }
81
+ }
82
+ async function runViaHVMCore(hvmPath, input) {
83
+ if (typeof window !== "undefined") {
84
+ const { WebContainerManager } = await import("./WebContainerManager-4LIOGRVM.js");
85
+ const wcm = WebContainerManager.getExistingInstance();
86
+ if (!wcm) {
87
+ throw new Error("WebContainer not available for HVM execution");
88
+ }
89
+ try {
90
+ const process = await wcm.spawn("hvm", ["run", hvmPath], {
91
+ cwd: "/home/project"
92
+ });
93
+ let output = "";
94
+ const reader = process.output.getReader();
95
+ while (true) {
96
+ const { done, value } = await reader.read();
97
+ if (done) break;
98
+ output += value;
99
+ }
100
+ const exitCode = await process.exit;
101
+ if (exitCode !== 0) {
102
+ throw new Error(`HVM execution failed with exit code ${exitCode}: ${output}`);
103
+ }
104
+ const match = output.match(/Result:\s*(\d+)/);
105
+ return match ? parseInt(match[1]) : output;
106
+ } catch (e) {
107
+ throw e;
108
+ }
109
+ }
110
+ throw new Error("Server-side HVM execution not implemented");
111
+ }
112
+ async function runViaWasm(wasmPath, input) {
113
+ const response = await fetch(wasmPath);
114
+ const wasmBytes = await response.arrayBuffer();
115
+ const wasmModule = await WebAssembly.instantiate(wasmBytes);
116
+ const instance = wasmModule.instance;
117
+ const main = instance.exports.main;
118
+ if (!main) {
119
+ throw new Error('WASM module does not export "main" function');
120
+ }
121
+ const result = main();
122
+ return result;
123
+ }
124
+ export {
125
+ runInHVM
126
+ };