@agentlang/lstudio 0.2.2 → 0.2.4

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 (30) hide show
  1. package/assets/fs-BFPzyhvM.js +1 -0
  2. package/assets/index-BZcC_1YB.css +1 -0
  3. package/assets/{index-r7-q4_iF-Cr8pMb-3.js → index-Bz3SWrlh-BOC9aAgh.js} +1 -1
  4. package/assets/{index-Bv8Vsab1.js → index-CWcv-6Zk.js} +442 -389
  5. package/assets/{index-DjgOAzh3.js → index-CuvfCO6A.js} +1 -1
  6. package/assets/{index-D4z_hbl0-CUGEU9es.js → index-D4z_hbl0-y_rvYJag.js} +1 -1
  7. package/assets/index-Dcg-T9P7.js +1 -0
  8. package/assets/index-Dsv5Y1bn.js +1 -0
  9. package/assets/{index-BGkQxT4m-C1mCQewh.js → index-hklP5STE-Bcq23IoH.js} +5 -5
  10. package/assets/{index-C8iIEab-.js → index-v-qSLw3O.js} +1 -1
  11. package/assets/{index.browser-DeDPTzNn.js → index.browser-CNuJpQRF.js} +3 -3
  12. package/assets/loadCognitoIdentity-CyU-paEc.js +1 -0
  13. package/assets/loadSts-_086JMFD.js +1 -0
  14. package/assets/{normalizeProvider-EC8cbfMc.js → normalizeProvider-BrOPyH3l.js} +1 -1
  15. package/assets/{replService-CCPvmbEx.js → replService-zFxUAnXb.js} +1 -1
  16. package/assets/resolveDefaultsModeConfig-D1zWPouA.js +15 -0
  17. package/assets/{util-Bzh8z3-b.js → util-DRQhMG0c.js} +1 -1
  18. package/assets/{winston-1qzyIKCb-Co5uzAFy.js → winston-1qzyIKCb-DrBzcKjE.js} +1 -1
  19. package/assets/{winston-9LLUP2iD.js → winston-BBhfKzmi.js} +1 -1
  20. package/assets/{winston-CtxF18qc-yrByRl6_.js → winston-CtxF18qc-R9Ff3XLo.js} +1 -1
  21. package/assets/{winston-BmZyhpGP.js → winston-oUPj17yo.js} +1 -1
  22. package/index.html +3 -3
  23. package/package.json +1 -1
  24. package/assets/AwsJson1_1Protocol-BuTiU31K.js +0 -1
  25. package/assets/index-B-OvH2Yt.css +0 -1
  26. package/assets/index-CIghMZpI.js +0 -1
  27. package/assets/index-CSWrk3qy.js +0 -15
  28. package/assets/index-Dds8U7KS.js +0 -1
  29. package/assets/loadCognitoIdentity-ieB3gz6G.js +0 -1
  30. package/assets/loadSts-BPFRej1_.js +0 -1
@@ -0,0 +1 @@
1
+ import{T as z}from"./index-CWcv-6Zk.js";import"./_commonjsHelpers-D6-XlEtG.js";import"./index-ChvoNxcO.js";import"./preload-helper-BlTxHScW.js";import"./__vite-browser-external-DLjrMatA.js";import"./inherits_browser-nmOknR35-Bp0mvRSL.js";import"./index-6mKfgpcs-DsgiI2lM.js";import"./_commonjsHelpers-B4e78b8K-W3E8ocG7.js";import"./index-DsIu-45t-Bejjlpz4.js";import"./index-DSosZ5sh-Ceejs_jv.js";import"./index-69shuAsh-DF18H7zf.js";import"./index-BJBOx-Z---hbiLl7B.js";import"./index.browser-BHPvGrwi-6Mh8eUw-.js";import"./_commonjs-dynamic-modules-BpilXLfW-DfYEAvWy.js";import"./_commonjs-dynamic-modules-B7n8ZNar.js";var S=Object.defineProperty,A=(r,e,n)=>e in r?S(r,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):r[e]=n,g=(r,e,n)=>A(r,typeof e!="symbol"?e+"":e,n);function j(r,e){for(var n=0;n<e.length;n++){const o=e[n];if(typeof o!="string"&&!Array.isArray(o)){for(const t in o)if(t!=="default"&&!(t in r)){const i=Object.getOwnPropertyDescriptor(o,t);i&&Object.defineProperty(r,t,i.get?i:{enumerable:!0,get:()=>o[t]})}}}return Object.freeze(Object.defineProperty(r,Symbol.toStringTag,{value:"Module"}))}function v(r){return{isFile:()=>r.isFile(),isDirectory:()=>r.isDirectory(),isSymbolicLink:()=>r.isSymbolicLink(),size:r.size,mtime:r.mtime}}class x{async readFile(e){return(void 0)(e,"utf8")}async readFileBuffer(e){return(void 0)(e)}async writeFile(e,n){const o=(void 0)(e);return await this.ensureDir(o),(void 0)(e,n)}async exists(e){try{return await(void 0)(e),!0}catch{return!1}}async mkdir(e){try{await(void 0)(e)}catch(n){if(n&&typeof n=="object"&&"code"in n&&n.code!=="EEXIST")throw n}}async readdir(e){return(void 0)(e)}async stat(e){const n=await(void 0)(e);return v(n)}async lstat(e){const n=await(void 0)(e);return v(n)}async unlink(e){return(void 0)(e)}async rmdir(e){return(void 0)(e)}async copyFile(e,n){const o=(void 0)(n);return await this.ensureDir(o),(void 0)(e,n)}async moveFile(e,n){const o=(void 0)(n);return await this.ensureDir(o),(void 0)(e,n)}async ensureDir(e){try{await(void 0)(e,{recursive:!0})}catch(n){if(n&&typeof n=="object"&&"code"in n&&n.code!=="EEXIST")throw n}}async removeDir(e){return(void 0)(e,{recursive:!0,force:!0})}async readDirectory(e){return(void 0)(e)}async writeFileSystemFromTree(e,n,o){for(const t of e){const i=(void 0)(n,t.path);if(t.type==="directory")await this.ensureDir(i),t.children&&await this.writeFileSystemFromTree(t.children,n,o);else{const s=await o(t.path);await this.writeFile(i,s)}}}}function $(){return new x}function T(r){return r&&r.__esModule&&Object.prototype.hasOwnProperty.call(r,"default")?r.default:r}var F,D;function E(){if(D)return F;D=1;function r(t){if(typeof t!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(t))}function e(t,i){for(var s="",c=0,u=-1,a=0,f,l=0;l<=t.length;++l){if(l<t.length)f=t.charCodeAt(l);else{if(f===47)break;f=47}if(f===47){if(!(u===l-1||a===1))if(u!==l-1&&a===2){if(s.length<2||c!==2||s.charCodeAt(s.length-1)!==46||s.charCodeAt(s.length-2)!==46){if(s.length>2){var d=s.lastIndexOf("/");if(d!==s.length-1){d===-1?(s="",c=0):(s=s.slice(0,d),c=s.length-1-s.lastIndexOf("/")),u=l,a=0;continue}}else if(s.length===2||s.length===1){s="",c=0,u=l,a=0;continue}}i&&(s.length>0?s+="/..":s="..",c=2)}else s.length>0?s+="/"+t.slice(u+1,l):s=t.slice(u+1,l),c=l-u-1;u=l,a=0}else f===46&&a!==-1?++a:a=-1}return s}function n(t,i){var s=i.dir||i.root,c=i.base||(i.name||"")+(i.ext||"");return s?s===i.root?s+c:s+t+c:c}var o={resolve:function(){for(var t="",i=!1,s,c=arguments.length-1;c>=-1&&!i;c--){var u;c>=0?u=arguments[c]:(s===void 0&&(s=process.cwd()),u=s),r(u),u.length!==0&&(t=u+"/"+t,i=u.charCodeAt(0)===47)}return t=e(t,!i),i?t.length>0?"/"+t:"/":t.length>0?t:"."},normalize:function(t){if(r(t),t.length===0)return".";var i=t.charCodeAt(0)===47,s=t.charCodeAt(t.length-1)===47;return t=e(t,!i),t.length===0&&!i&&(t="."),t.length>0&&s&&(t+="/"),i?"/"+t:t},isAbsolute:function(t){return r(t),t.length>0&&t.charCodeAt(0)===47},join:function(){if(arguments.length===0)return".";for(var t,i=0;i<arguments.length;++i){var s=arguments[i];r(s),s.length>0&&(t===void 0?t=s:t+="/"+s)}return t===void 0?".":o.normalize(t)},relative:function(t,i){if(r(t),r(i),t===i||(t=o.resolve(t),i=o.resolve(i),t===i))return"";for(var s=1;s<t.length&&t.charCodeAt(s)===47;++s);for(var c=t.length,u=c-s,a=1;a<i.length&&i.charCodeAt(a)===47;++a);for(var f=i.length,l=f-a,d=u<l?u:l,y=-1,h=0;h<=d;++h){if(h===d){if(l>d){if(i.charCodeAt(a+h)===47)return i.slice(a+h+1);if(h===0)return i.slice(a+h)}else u>d&&(t.charCodeAt(s+h)===47?y=h:h===0&&(y=0));break}var b=t.charCodeAt(s+h),I=i.charCodeAt(a+h);if(b!==I)break;b===47&&(y=h)}var p="";for(h=s+y+1;h<=c;++h)(h===c||t.charCodeAt(h)===47)&&(p.length===0?p+="..":p+="/..");return p.length>0?p+i.slice(a+y):(a+=y,i.charCodeAt(a)===47&&++a,i.slice(a))},_makeLong:function(t){return t},dirname:function(t){if(r(t),t.length===0)return".";for(var i=t.charCodeAt(0),s=i===47,c=-1,u=!0,a=t.length-1;a>=1;--a)if(i=t.charCodeAt(a),i===47){if(!u){c=a;break}}else u=!1;return c===-1?s?"/":".":s&&c===1?"//":t.slice(0,c)},basename:function(t,i){if(i!==void 0&&typeof i!="string")throw new TypeError('"ext" argument must be a string');r(t);var s=0,c=-1,u=!0,a;if(i!==void 0&&i.length>0&&i.length<=t.length){if(i.length===t.length&&i===t)return"";var f=i.length-1,l=-1;for(a=t.length-1;a>=0;--a){var d=t.charCodeAt(a);if(d===47){if(!u){s=a+1;break}}else l===-1&&(u=!1,l=a+1),f>=0&&(d===i.charCodeAt(f)?--f===-1&&(c=a):(f=-1,c=l))}return s===c?c=l:c===-1&&(c=t.length),t.slice(s,c)}else{for(a=t.length-1;a>=0;--a)if(t.charCodeAt(a)===47){if(!u){s=a+1;break}}else c===-1&&(u=!1,c=a+1);return c===-1?"":t.slice(s,c)}},extname:function(t){r(t);for(var i=-1,s=0,c=-1,u=!0,a=0,f=t.length-1;f>=0;--f){var l=t.charCodeAt(f);if(l===47){if(!u){s=f+1;break}continue}c===-1&&(u=!1,c=f+1),l===46?i===-1?i=f:a!==1&&(a=1):i!==-1&&(a=-1)}return i===-1||c===-1||a===0||a===1&&i===c-1&&i===s+1?"":t.slice(i,c)},format:function(t){if(t===null||typeof t!="object")throw new TypeError('The "pathObject" argument must be of type Object. Received type '+typeof t);return n("/",t)},parse:function(t){r(t);var i={root:"",dir:"",base:"",ext:"",name:""};if(t.length===0)return i;var s=t.charCodeAt(0),c=s===47,u;c?(i.root="/",u=1):u=0;for(var a=-1,f=0,l=-1,d=!0,y=t.length-1,h=0;y>=u;--y){if(s=t.charCodeAt(y),s===47){if(!d){f=y+1;break}continue}l===-1&&(d=!1,l=y+1),s===46?a===-1?a=y:h!==1&&(h=1):a!==-1&&(h=-1)}return a===-1||l===-1||h===0||h===1&&a===l-1&&a===f+1?l!==-1&&(f===0&&c?i.base=i.name=t.slice(1,l):i.base=i.name=t.slice(f,l)):(f===0&&c?(i.name=t.slice(1,a),i.base=t.slice(1,l)):(i.name=t.slice(f,a),i.base=t.slice(f,l)),i.ext=t.slice(a,l)),f>0?i.dir=t.slice(0,f-1):c&&(i.dir="/"),i},sep:"/",delimiter:":",win32:null,posix:null};return o.posix=o,F=o,F}var k=E();const O=T(k),L=j({__proto__:null,default:O},[k]);function C(r){if(r&&typeof r=="object"){const e=r,n=typeof e.isFile=="function"?e.isFile():typeof e.isFile=="boolean"?e.isFile:e.type==="file"||!e.type&&!e.isDirectory,o=typeof e.isDirectory=="function"?e.isDirectory():typeof e.isDirectory=="boolean"?e.isDirectory:e.type==="dir"||e.type==="directory",t=typeof e.size=="number"?e.size:0;let i;return e.mtime instanceof Date?i=e.mtime:typeof e.mtime=="number"?i=new Date(e.mtime):typeof e.mtimeMs=="number"?i=new Date(e.mtimeMs):i=new Date,{isFile:()=>n,isDirectory:()=>o,isSymbolicLink:()=>!1,size:t,mtime:i}}return{isFile:()=>!0,isDirectory:()=>!1,isSymbolicLink:()=>!1,size:0,mtime:new Date}}class R{constructor(){g(this,"fs"),g(this,"initialized",!1),g(this,"path",L)}async initialize(e={}){if(this.initialized)return;const n=e.name||"fs",o=new z(n,{wipe:e.wipe});this.fs=o.promises,this.initialized=!0}ensureInitialized(){if(!this.initialized)throw new Error("LightningFileSystem is not initialized. Call initialize() first.")}async readFile(e){return this.ensureInitialized(),(await this.fs.readFile(e,{encoding:"utf8"})).toString()}async readFileBuffer(e){return this.ensureInitialized(),this.fs.readFile(e)}async writeFile(e,n){this.ensureInitialized();const o=e.substring(0,e.lastIndexOf("/"));return o&&await this.ensureDir(o),this.fs.writeFile(e,n)}async exists(e){this.ensureInitialized();try{return await this.fs.stat(e),!0}catch{return!1}}async mkdir(e,n){this.ensureInitialized();try{return await this.fs.mkdir(e,n)}catch(o){if(o&&typeof o=="object"&&"code"in o&&o.code!=="EEXIST")throw o}}async readdir(e){return this.ensureInitialized(),this.fs.readdir(e)}async stat(e){this.ensureInitialized();const n=await this.fs.stat(e);return C(n)}async lstat(e){this.ensureInitialized();const n=await this.fs.stat(e);return C(n)}async unlink(e){return this.ensureInitialized(),this.fs.unlink(e)}async rmdir(e){return this.ensureInitialized(),this.fs.rmdir(e)}async copyFile(e,n){this.ensureInitialized();const o=n.substring(0,n.lastIndexOf("/"));o&&await this.ensureDir(o);const t=await this.readFileBuffer(e);return this.writeFile(n,t)}async moveFile(e,n){this.ensureInitialized();const o=n.substring(0,n.lastIndexOf("/"));o&&await this.ensureDir(o),await this.copyFile(e,n),await this.unlink(e)}async ensureDir(e){if(this.ensureInitialized(),!await this.exists(e))try{await this.fs.mkdir(e,{recursive:!0})}catch(n){if(n&&typeof n=="object"&&"code"in n&&n.code!=="EEXIST")throw n}}async removeDir(e){if(this.ensureInitialized(),!await this.exists(e))return;if((await this.stat(e)).isFile())return this.unlink(e);const n=await this.readdir(e);for(const o of n){const t=`${e}/${o}`;await this.removeDir(t)}return this.rmdir(e)}async readDirectory(e){return this.ensureInitialized(),this.fs.readdir(e)}async writeFileSystemFromTree(e,n,o){for(const t of e){const i=this.path.join(n,t.path);if(t.type==="directory")await this.mkdir(i,{recursive:!0}),t.children&&await this.writeFileSystemFromTree(t.children,n,o);else{const s=await o(t.path);await this.writeFile(i,s)}}}}async function P(r){const e=new R;return await e.initialize(r),e}function _(){return"http://localhost:4000"}const m=_();function w(r){let e=r.replace(/^\/+/,"");const n=e.split("/");return n.length>1&&(e=n.slice(1).join("/")),e}function B(){return{async readFile(r){const e=w(r),n=await fetch(`${m}/file?path=${encodeURIComponent(e)}`);if(!n.ok)throw new Error(`Failed to read file ${r}: ${n.statusText}`);const{content:o}=await n.json();return o},async readFileBuffer(r){const e=await this.readFile(r);return Buffer.from(e,"utf-8")},async writeFile(r,e){const n=w(r),o=typeof e=="string"?e:e.toString("utf-8"),t=await fetch(`${m}/file`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({path:n,content:o})});if(!t.ok)throw new Error(`Failed to write file ${r}: ${t.statusText}`)},async exists(r){const e=w(r);try{if((await fetch(`${m}/file?path=${encodeURIComponent(e)}`)).ok)return!0}catch{}try{if((await fetch(`${m}/files?path=${encodeURIComponent(e)}`)).ok)return!0}catch{}return!1},async mkdir(r){},async readdir(r){const e=w(r),n=await fetch(`${m}/files?path=${encodeURIComponent(e)}`);if(!n.ok)throw new Error(`Failed to read directory ${r}: ${n.statusText}`);return(await n.json()).map(o=>o.name)},async stat(r){const e=w(r);try{const n=await fetch(`${m}/file?path=${encodeURIComponent(e)}`);if(n.ok){const{content:o}=await n.json();return{isFile:()=>!0,isDirectory:()=>!1,isSymbolicLink:()=>!1,size:o.length,mtime:new Date}}}catch{}try{if((await fetch(`${m}/files?path=${encodeURIComponent(e)}`)).ok)return{isFile:()=>!1,isDirectory:()=>!0,isSymbolicLink:()=>!1,size:0,mtime:new Date}}catch{}return{isFile:()=>!1,isDirectory:()=>!1,isSymbolicLink:()=>!1,size:0,mtime:new Date}},async lstat(r){return this.stat(r)},async unlink(r){throw new Error("File deletion not supported in CLI mode")},async rmdir(r){throw new Error("Directory deletion not supported in CLI mode")},async copyFile(r,e){const n=await this.readFile(r);await this.writeFile(e,n)},async moveFile(r,e){await this.copyFile(r,e)},async ensureDir(r){},async removeDir(r){throw new Error("Directory deletion not supported in CLI mode")},async readDirectory(r){return this.readdir(r)},async writeFileSystemFromTree(r,e,n){console.debug("writeFileSystemFromTree called - no-op in CLI mode")}}}async function te(r){return typeof window>"u"?$():r!=null&&r.useCliBackend?B():P(r)}export{B as createCliFS,te as createFS,P as createLightningFS,$ as createNodeFS};