planx 20.21.6 → 20.24.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/agent.main.mjs +9 -9
- package/blob.main.mjs +2 -2
- package/config.main.mjs +2 -2
- package/domain.main.mjs +2 -2
- package/exit.main.mjs +2 -2
- package/explorer.main.mjs +1 -1
- package/filesystem.main.mjs +2 -2
- package/llm.main.mjs +1 -1
- package/log.main.mjs +1 -1
- package/main.js +416 -416
- package/package.json +6 -6
- package/planx-networkd.main.mjs +1 -1
- package/presentation.main.mjs +1 -1
- package/session.main.mjs +162 -162
- package/transport.main.mjs +91 -91
package/explorer.main.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
globalThis.__PLANX_SERVICE_VERSION__="20.
|
|
1
|
+
globalThis.__PLANX_SERVICE_VERSION__="20.24.2";
|
|
2
2
|
import*as Ce from"fs";import{dirname as Tt,join as Lt}from"path";function re(e,t){let n=e[t];if(!n)throw new Error(`explorer child \u306E\u8D77\u52D5\u306B ${t} \u304C\u5FC5\u8981\u3067\u3059`);return n}function Fe(e=process.env){let t=Number(e.PLANX_EXPLORER_LEASE_MS??"");return{port:Number(e.PORT??0),portFile:e.PLANX_EXPLORER_PORT_FILE,pidFile:e.PLANX_EXPLORER_PID_FILE,sessionPortFile:re(e,"PLANX_SESSION_PORT_FILE"),domainPortFile:e.PLANX_DOMAIN_PORT_FILE??Lt(Tt(re(e,"PLANX_SESSION_PORT_FILE")),"domain.port"),filesystemPortFile:re(e,"PLANX_FILESYSTEM_PORT_FILE"),...Number.isInteger(t)&&t>0?{leaseMs:t}:{}}}import{existsSync as It,readFileSync as Ft}from"fs";function j(e,t){if(!It(e))throw new Error(`${t} \u304C\u8D77\u52D5\u3057\u3066\u3044\u307E\u305B\u3093: ${e} \u304C\u898B\u3064\u304B\u308A\u307E\u305B\u3093`);let n=Number(Ft(e,"utf-8").trim());if(!Number.isInteger(n)||n<=0)throw new Error(`${t} \u306E port file \u304C\u4E0D\u6B63\u3067\u3059: ${e}`);return n}import{readFileSync as Mt}from"fs";var kt=250,Ht=e=>new Promise(t=>setTimeout(t,e)),ne=class extends Error{constructor(n,r){super(n);this.status=r;this.name="DoRequestError"}};async function $t(e,t){if(!e.ok)throw new ne(`${t} \u306B\u5931\u6557\u3057\u307E\u3057\u305F (${e.status}): ${await e.text()}`,e.status)}async function Me(e){let t=e.sleep??Ht,n=Mt(e.bundlePath,"utf-8"),r=null;for(let s=1;s<=(e.attempts??30);s+=1)try{let o=e.deployUrl(),i=await fetch(o,{method:"POST",headers:e.headers,body:n});await $t(i,"explorer plugin \u306E install");return}catch(o){r=o,await t(kt*4)}throw r}function se(e){try{return new URL(e).pathname}catch{return""}}function N(e){let t=se(e);return t?t.endsWith("/")?t:t.slice(0,t.lastIndexOf("/")+1):""}var ke=10,oe=`http://127.0.0.1:${ke}`,He="x-planx-session-id";function U(e){try{return new URL(e).port===String(ke)}catch{return!1}}function ie(e,t){return!t||!e.startsWith(t)?e:oe+e.slice(t.length)}function Dt(e){if(e)return`${oe}${e.endsWith("/")?e:`${e}/`}`}async function jt(e,t){let n=new Set(e.map(i=>i.id)),r=new Set(t.sessionIds()),s=[...r].filter(i=>!n.has(i)).map(i=>t.detach(i)),o=e.filter(i=>!r.has(i.id)).map(i=>t.attach(i.id,{home:Dt(i.cwd)}));await Promise.all([...s,...o].map(i=>i.catch(a=>t.onError?.(a))))}async function*Nt(e){let t=e.getReader(),n=new TextDecoder,r="";for(;;){let{done:s,value:o}=await t.read();if(s)return;r+=n.decode(o,{stream:!0});let i=r.indexOf(`
|
|
3
3
|
|
|
4
4
|
`);for(;i>=0;){let a=r.slice(0,i).split(`
|