feat: Add Be and tbd skill, also added Roadmap file

This commit is contained in:
2026-05-10 16:32:12 -04:00
parent 3500ade13f
commit 0bb8885802
29587 changed files with 10611695 additions and 0 deletions

View File

@@ -0,0 +1,27 @@
"use strict";
exports.__esModule = true;
exports.memoryMiddlewareFactory = memoryMiddlewareFactory;
// a simple in-memory cache for resources
var cache = {};
function memoryMiddlewareFactory() {
return function memoryMiddleware(resource, next) {
var _this = this;
// if cached, then set data and complete the resource
if (cache[resource.url]) {
resource.data = cache[resource.url];
resource.complete(); // marks resource load complete and stops processing before middlewares
}
// if not cached, wait for complete and store it in the cache.
else {
resource.onComplete.once(function () {
return cache[_this.url] = _this.data;
});
}
next();
};
}
//# sourceMappingURL=memory.js.map

View File

@@ -0,0 +1 @@
{"version":3,"sources":["../../../src/middlewares/caching/memory.js"],"names":["memoryMiddlewareFactory","cache","memoryMiddleware","resource","next","url","data","complete","onComplete","once"],"mappings":";;;QAGgBA,uB,GAAAA,uB;AAHhB;AACA,IAAMC,QAAQ,EAAd;;AAEO,SAASD,uBAAT,GAAmC;AACtC,WAAO,SAASE,gBAAT,CAA0BC,QAA1B,EAAoCC,IAApC,EAA0C;AAAA;;AAC7C;AACA,YAAIH,MAAME,SAASE,GAAf,CAAJ,EAAyB;AACrBF,qBAASG,IAAT,GAAgBL,MAAME,SAASE,GAAf,CAAhB;AACAF,qBAASI,QAAT,GAFqB,CAEA;AACxB;AACD;AAJA,aAKK;AACDJ,yBAASK,UAAT,CAAoBC,IAApB,CAAyB;AAAA,2BAAOR,MAAM,MAAKI,GAAX,IAAkB,MAAKC,IAA9B;AAAA,iBAAzB;AACH;;AAEDF;AACH,KAZD;AAaH","file":"memory.js","sourcesContent":["// a simple in-memory cache for resources\nconst cache = {};\n\nexport function memoryMiddlewareFactory() {\n return function memoryMiddleware(resource, next) {\n // if cached, then set data and complete the resource\n if (cache[resource.url]) {\n resource.data = cache[resource.url];\n resource.complete(); // marks resource load complete and stops processing before middlewares\n }\n // if not cached, wait for complete and store it in the cache.\n else {\n resource.onComplete.once(() => (cache[this.url] = this.data));\n }\n\n next();\n };\n}\n"]}

View File

@@ -0,0 +1,87 @@
'use strict';
exports.__esModule = true;
var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; };
exports.blobMiddlewareFactory = blobMiddlewareFactory;
var _Resource = require('../../Resource');
var _Resource2 = _interopRequireDefault(_Resource);
var _b = require('../../b64');
var _b2 = _interopRequireDefault(_b);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
var Url = window.URL || window.webkitURL;
// a middleware for transforming XHR loaded Blobs into more useful objects
function blobMiddlewareFactory() {
return function blobMiddleware(resource, next) {
if (!resource.data) {
next();
return;
}
// if this was an XHR load of a blob
if (resource.xhr && resource.xhrType === _Resource2.default.XHR_RESPONSE_TYPE.BLOB) {
// if there is no blob support we probably got a binary string back
if (!window.Blob || typeof resource.data === 'string') {
var type = resource.xhr.getResponseHeader('content-type');
// this is an image, convert the binary string into a data url
if (type && type.indexOf('image') === 0) {
resource.data = new Image();
resource.data.src = 'data:' + type + ';base64,' + _b2.default.encodeBinary(resource.xhr.responseText);
resource.type = _Resource2.default.TYPE.IMAGE;
// wait until the image loads and then callback
resource.data.onload = function () {
resource.data.onload = null;
next();
};
// next will be called on load
return;
}
}
// if content type says this is an image, then we should transform the blob into an Image object
else if (resource.data.type.indexOf('image') === 0) {
var _ret = function () {
var src = Url.createObjectURL(resource.data);
resource.blob = resource.data;
resource.data = new Image();
resource.data.src = src;
resource.type = _Resource2.default.TYPE.IMAGE;
// cleanup the no longer used blob after the image loads
// TODO: Is this correct? Will the image be invalid after revoking?
resource.data.onload = function () {
Url.revokeObjectURL(src);
resource.data.onload = null;
next();
};
// next will be called on load.
return {
v: void 0
};
}();
if ((typeof _ret === 'undefined' ? 'undefined' : _typeof(_ret)) === "object") return _ret.v;
}
}
next();
};
}
//# sourceMappingURL=blob.js.map

View File

@@ -0,0 +1 @@
{"version":3,"sources":["../../../src/middlewares/parsing/blob.js"],"names":["blobMiddlewareFactory","Url","window","URL","webkitURL","blobMiddleware","resource","next","data","xhr","xhrType","XHR_RESPONSE_TYPE","BLOB","Blob","type","getResponseHeader","indexOf","Image","src","encodeBinary","responseText","TYPE","IMAGE","onload","createObjectURL","blob","revokeObjectURL"],"mappings":";;;;;;QAMgBA,qB,GAAAA,qB;;AANhB;;;;AACA;;;;;;AAEA,IAAMC,MAAMC,OAAOC,GAAP,IAAcD,OAAOE,SAAjC;;AAEA;AACO,SAASJ,qBAAT,GAAiC;AACpC,WAAO,SAASK,cAAT,CAAwBC,QAAxB,EAAkCC,IAAlC,EAAwC;AAC3C,YAAI,CAACD,SAASE,IAAd,EAAoB;AAChBD;;AAEA;AACH;;AAED;AACA,YAAID,SAASG,GAAT,IAAgBH,SAASI,OAAT,KAAqB,mBAASC,iBAAT,CAA2BC,IAApE,EAA0E;AACtE;AACA,gBAAI,CAACV,OAAOW,IAAR,IAAgB,OAAOP,SAASE,IAAhB,KAAyB,QAA7C,EAAuD;AACnD,oBAAMM,OAAOR,SAASG,GAAT,CAAaM,iBAAb,CAA+B,cAA/B,CAAb;;AAEA;AACA,oBAAID,QAAQA,KAAKE,OAAL,CAAa,OAAb,MAA0B,CAAtC,EAAyC;AACrCV,6BAASE,IAAT,GAAgB,IAAIS,KAAJ,EAAhB;AACAX,6BAASE,IAAT,CAAcU,GAAd,aAA4BJ,IAA5B,gBAA2C,YAAIK,YAAJ,CAAiBb,SAASG,GAAT,CAAaW,YAA9B,CAA3C;;AAEAd,6BAASQ,IAAT,GAAgB,mBAASO,IAAT,CAAcC,KAA9B;;AAEA;AACAhB,6BAASE,IAAT,CAAce,MAAd,GAAuB,YAAM;AACzBjB,iCAASE,IAAT,CAAce,MAAd,GAAuB,IAAvB;;AAEAhB;AACH,qBAJD;;AAMA;AACA;AACH;AACJ;AACD;AArBA,iBAsBK,IAAID,SAASE,IAAT,CAAcM,IAAd,CAAmBE,OAAnB,CAA2B,OAA3B,MAAwC,CAA5C,EAA+C;AAAA;AAChD,4BAAME,MAAMjB,IAAIuB,eAAJ,CAAoBlB,SAASE,IAA7B,CAAZ;;AAEAF,iCAASmB,IAAT,GAAgBnB,SAASE,IAAzB;AACAF,iCAASE,IAAT,GAAgB,IAAIS,KAAJ,EAAhB;AACAX,iCAASE,IAAT,CAAcU,GAAd,GAAoBA,GAApB;;AAEAZ,iCAASQ,IAAT,GAAgB,mBAASO,IAAT,CAAcC,KAA9B;;AAEA;AACA;AACAhB,iCAASE,IAAT,CAAce,MAAd,GAAuB,YAAM;AACzBtB,gCAAIyB,eAAJ,CAAoBR,GAApB;AACAZ,qCAASE,IAAT,CAAce,MAAd,GAAuB,IAAvB;;AAEAhB;AACH,yBALD;;AAOA;AACA;AAAA;AAAA;AAnBgD;;AAAA;AAoBnD;AACJ;;AAEDA;AACH,KAxDD;AAyDH","file":"blob.js","sourcesContent":["import Resource from '../../Resource';\nimport b64 from '../../b64';\n\nconst Url = window.URL || window.webkitURL;\n\n// a middleware for transforming XHR loaded Blobs into more useful objects\nexport function blobMiddlewareFactory() {\n return function blobMiddleware(resource, next) {\n if (!resource.data) {\n next();\n\n return;\n }\n\n // if this was an XHR load of a blob\n if (resource.xhr && resource.xhrType === Resource.XHR_RESPONSE_TYPE.BLOB) {\n // if there is no blob support we probably got a binary string back\n if (!window.Blob || typeof resource.data === 'string') {\n const type = resource.xhr.getResponseHeader('content-type');\n\n // this is an image, convert the binary string into a data url\n if (type && type.indexOf('image') === 0) {\n resource.data = new Image();\n resource.data.src = `data:${type};base64,${b64.encodeBinary(resource.xhr.responseText)}`;\n\n resource.type = Resource.TYPE.IMAGE;\n\n // wait until the image loads and then callback\n resource.data.onload = () => {\n resource.data.onload = null;\n\n next();\n };\n\n // next will be called on load\n return;\n }\n }\n // if content type says this is an image, then we should transform the blob into an Image object\n else if (resource.data.type.indexOf('image') === 0) {\n const src = Url.createObjectURL(resource.data);\n\n resource.blob = resource.data;\n resource.data = new Image();\n resource.data.src = src;\n\n resource.type = Resource.TYPE.IMAGE;\n\n // cleanup the no longer used blob after the image loads\n // TODO: Is this correct? Will the image be invalid after revoking?\n resource.data.onload = () => {\n Url.revokeObjectURL(src);\n resource.data.onload = null;\n\n next();\n };\n\n // next will be called on load.\n return;\n }\n }\n\n next();\n };\n}\n"]}