typebulb 0.51.0 → 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 +219 -240
- package/dist/render.js +11 -16
- package/dist/servers.js +105 -110
- 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,
|