typebulb 0.51.1 → 0.51.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.
- package/SKILL.md +2 -2
- package/dist/agents/claude/client.js +11 -16
- package/dist/agents/codex/client.js +11 -16
- package/dist/agents/pi/client.js +11 -16
- package/dist/ai/inference.d.ts.map +1 -1
- package/dist/ai/inference.js +9 -2
- package/dist/ai/inference.js.map +1 -1
- package/dist/dts/tbTypings.d.ts.map +1 -1
- package/dist/dts/tbTypings.js +0 -16
- package/dist/dts/tbTypings.js.map +1 -1
- package/dist/index.js +165 -186
- package/dist/render.js +11 -16
- package/dist/servers.js +11 -16
- package/package.json +1 -1
package/dist/render.js
CHANGED
|
@@ -723,19 +723,17 @@ const something = require('module-name') // NOT SUPPORTED!
|
|
|
723
723
|
|
|
724
724
|
// tb.infer() \u2014 the local inference layer (TB-Inference.md). The UI and network live in the
|
|
725
725
|
// lazy-imported modal module (/__infer-ui.js \u2014 zero bytes here until the first call); the shim
|
|
726
|
-
// stays the
|
|
726
|
+
// stays the concurrency guard and globals writer. The promise settles once: a modal retry after a
|
|
727
727
|
// rejected promise still updates runtime state on success, for tb.insight() readers.
|
|
728
|
-
let
|
|
729
|
-
let dataOverrides = null;
|
|
728
|
+
let inferRunning = false;
|
|
730
729
|
const infer = (opts = {}) => {
|
|
731
730
|
if (isFramed) return Promise.reject(inlineErr('tb.infer()'));
|
|
732
|
-
if (
|
|
733
|
-
|
|
734
|
-
// Data
|
|
735
|
-
//
|
|
736
|
-
//
|
|
731
|
+
if (inferRunning) return Promise.reject(new Error('Inference already in progress'));
|
|
732
|
+
inferRunning = true;
|
|
733
|
+
// Data to preview: the explicit arg, else undefined \u2014 the modal then seeds from the SOURCE
|
|
734
|
+
// chunks (/__infer-info), the local Data tab, exactly as .com's IDE modal reseeds from the
|
|
735
|
+
// Data tab rather than post-run runtime state.
|
|
737
736
|
let data = opts.data;
|
|
738
|
-
if (data === undefined && dataOverrides) data = Object.values(dataOverrides);
|
|
739
737
|
if (data !== undefined && !Array.isArray(data)) data = [data];
|
|
740
738
|
return new Promise((resolve, reject) => {
|
|
741
739
|
let settled = false;
|
|
@@ -751,19 +749,19 @@ const something = require('module-name') // NOT SUPPORTED!
|
|
|
751
749
|
window.__TB_INSIGHT__ = final.insightJson;
|
|
752
750
|
if (final.data && final.data.length) window.__TB_DATA__ = final.data;
|
|
753
751
|
if (final.hash) history.replaceState(null, '', location.pathname + location.search + final.hash);
|
|
754
|
-
|
|
752
|
+
inferRunning = false;
|
|
755
753
|
settle(resolve, final.insight);
|
|
756
754
|
},
|
|
757
755
|
onError: (err) => {
|
|
758
|
-
|
|
756
|
+
inferRunning = false;
|
|
759
757
|
const e = new Error(err.message); e.code = err.code; e.retryable = !!err.retryable;
|
|
760
758
|
settle(reject, e);
|
|
761
759
|
},
|
|
762
760
|
onCancel: () => {
|
|
763
|
-
if (!settled) {
|
|
761
|
+
if (!settled) { inferRunning = false; settle(resolve, undefined); }
|
|
764
762
|
}
|
|
765
763
|
});
|
|
766
|
-
}).catch((e) => {
|
|
764
|
+
}).catch((e) => { inferRunning = false; settle(reject, e); });
|
|
767
765
|
});
|
|
768
766
|
};
|
|
769
767
|
|
|
@@ -812,9 +810,6 @@ const something = require('module-name') // NOT SUPPORTED!
|
|
|
812
810
|
|
|
813
811
|
// Inference (TB-Inference.md) \u2014 modal-hosted one-shot LLM call over the bulb's own blocks
|
|
814
812
|
infer,
|
|
815
|
-
inferenceState: () => inferState,
|
|
816
|
-
setData: (index, content) => { if (!dataOverrides) dataOverrides = {}; dataOverrides[index] = content; },
|
|
817
|
-
resetInferenceState: () => { inferState = 'idle'; dataOverrides = null; },
|
|
818
813
|
|
|
819
814
|
// AI - tb.ai() proxies to the provider via the local server; tb.ai.stream() streams AiChunks.
|
|
820
815
|
ai,
|
package/dist/servers.js
CHANGED
|
@@ -510,19 +510,17 @@ ${s}`}function Xd(t){let e=ur.filter(n=>t[n]).map(n=>f0(n,t[n]));return["---",`f
|
|
|
510
510
|
|
|
511
511
|
// tb.infer() \u2014 the local inference layer (TB-Inference.md). The UI and network live in the
|
|
512
512
|
// lazy-imported modal module (/__infer-ui.js \u2014 zero bytes here until the first call); the shim
|
|
513
|
-
// stays the
|
|
513
|
+
// stays the concurrency guard and globals writer. The promise settles once: a modal retry after a
|
|
514
514
|
// rejected promise still updates runtime state on success, for tb.insight() readers.
|
|
515
|
-
let
|
|
516
|
-
let dataOverrides = null;
|
|
515
|
+
let inferRunning = false;
|
|
517
516
|
const infer = (opts = {}) => {
|
|
518
517
|
if (isFramed) return Promise.reject(inlineErr('tb.infer()'));
|
|
519
|
-
if (
|
|
520
|
-
|
|
521
|
-
// Data
|
|
522
|
-
//
|
|
523
|
-
//
|
|
518
|
+
if (inferRunning) return Promise.reject(new Error('Inference already in progress'));
|
|
519
|
+
inferRunning = true;
|
|
520
|
+
// Data to preview: the explicit arg, else undefined \u2014 the modal then seeds from the SOURCE
|
|
521
|
+
// chunks (/__infer-info), the local Data tab, exactly as .com's IDE modal reseeds from the
|
|
522
|
+
// Data tab rather than post-run runtime state.
|
|
524
523
|
let data = opts.data;
|
|
525
|
-
if (data === undefined && dataOverrides) data = Object.values(dataOverrides);
|
|
526
524
|
if (data !== undefined && !Array.isArray(data)) data = [data];
|
|
527
525
|
return new Promise((resolve, reject) => {
|
|
528
526
|
let settled = false;
|
|
@@ -538,19 +536,19 @@ ${s}`}function Xd(t){let e=ur.filter(n=>t[n]).map(n=>f0(n,t[n]));return["---",`f
|
|
|
538
536
|
window.__TB_INSIGHT__ = final.insightJson;
|
|
539
537
|
if (final.data && final.data.length) window.__TB_DATA__ = final.data;
|
|
540
538
|
if (final.hash) history.replaceState(null, '', location.pathname + location.search + final.hash);
|
|
541
|
-
|
|
539
|
+
inferRunning = false;
|
|
542
540
|
settle(resolve, final.insight);
|
|
543
541
|
},
|
|
544
542
|
onError: (err) => {
|
|
545
|
-
|
|
543
|
+
inferRunning = false;
|
|
546
544
|
const e = new Error(err.message); e.code = err.code; e.retryable = !!err.retryable;
|
|
547
545
|
settle(reject, e);
|
|
548
546
|
},
|
|
549
547
|
onCancel: () => {
|
|
550
|
-
if (!settled) {
|
|
548
|
+
if (!settled) { inferRunning = false; settle(resolve, undefined); }
|
|
551
549
|
}
|
|
552
550
|
});
|
|
553
|
-
}).catch((e) => {
|
|
551
|
+
}).catch((e) => { inferRunning = false; settle(reject, e); });
|
|
554
552
|
});
|
|
555
553
|
};
|
|
556
554
|
|
|
@@ -599,9 +597,6 @@ ${s}`}function Xd(t){let e=ur.filter(n=>t[n]).map(n=>f0(n,t[n]));return["---",`f
|
|
|
599
597
|
|
|
600
598
|
// Inference (TB-Inference.md) \u2014 modal-hosted one-shot LLM call over the bulb's own blocks
|
|
601
599
|
infer,
|
|
602
|
-
inferenceState: () => inferState,
|
|
603
|
-
setData: (index, content) => { if (!dataOverrides) dataOverrides = {}; dataOverrides[index] = content; },
|
|
604
|
-
resetInferenceState: () => { inferState = 'idle'; dataOverrides = null; },
|
|
605
600
|
|
|
606
601
|
// AI - tb.ai() proxies to the provider via the local server; tb.ai.stream() streams AiChunks.
|
|
607
602
|
ai,
|