clawpad 0.4.11 → 0.4.12
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/.next/standalone/.next/BUILD_ID +1 -1
- package/.next/standalone/.next/app-path-routes-manifest.json +10 -10
- package/.next/standalone/.next/build-manifest.json +3 -3
- package/.next/standalone/.next/prerender-manifest.json +3 -3
- package/.next/standalone/.next/react-loadable-manifest.json +1 -1
- package/.next/standalone/.next/server/app/_global-error/page_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/app/_global-error.html +2 -2
- package/.next/standalone/.next/server/app/_global-error.rsc +1 -1
- package/.next/standalone/.next/server/app/_global-error.segments/_full.segment.rsc +1 -1
- package/.next/standalone/.next/server/app/_global-error.segments/_global-error/__PAGE__.segment.rsc +1 -1
- package/.next/standalone/.next/server/app/_global-error.segments/_global-error.segment.rsc +1 -1
- package/.next/standalone/.next/server/app/_global-error.segments/_head.segment.rsc +1 -1
- package/.next/standalone/.next/server/app/_global-error.segments/_index.segment.rsc +1 -1
- package/.next/standalone/.next/server/app/_global-error.segments/_tree.segment.rsc +1 -1
- package/.next/standalone/.next/server/app/_not-found/page_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/app/_not-found.html +1 -1
- package/.next/standalone/.next/server/app/_not-found.rsc +1 -1
- package/.next/standalone/.next/server/app/_not-found.segments/_full.segment.rsc +1 -1
- package/.next/standalone/.next/server/app/_not-found.segments/_head.segment.rsc +1 -1
- package/.next/standalone/.next/server/app/_not-found.segments/_index.segment.rsc +1 -1
- package/.next/standalone/.next/server/app/_not-found.segments/_not-found/__PAGE__.segment.rsc +1 -1
- package/.next/standalone/.next/server/app/_not-found.segments/_not-found.segment.rsc +1 -1
- package/.next/standalone/.next/server/app/_not-found.segments/_tree.segment.rsc +1 -1
- package/.next/standalone/.next/server/app/api/ai/write/route.js +3 -3
- package/.next/standalone/.next/server/app/api/ai/write/route_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/app/api/changes/[id]/route_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/app/api/changes/record/route_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/app/api/changes/revert/route_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/app/api/changes/route_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/app/api/changes/run/route_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/app/api/chat/abort/route_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/app/api/chat/route.js +1 -1
- package/.next/standalone/.next/server/app/api/chat/route_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/app/api/files/pages/[...path]/route_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/app/api/files/recent/route_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/app/api/files/search/route_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/app/api/files/spaces/[space]/pages/route_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/app/api/files/spaces/route_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/app/api/files/watch/route_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/app/api/gateway/config/route_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/app/api/gateway/detect/route.js +3 -3
- package/.next/standalone/.next/server/app/api/gateway/detect/route_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/app/api/gateway/events/route.js +1 -1
- package/.next/standalone/.next/server/app/api/gateway/events/route_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/app/api/gateway/features/route_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/app/api/gateway/history/route_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/app/api/gateway/resolve/route_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/app/api/gateway/sessions/route.js +2 -2
- package/.next/standalone/.next/server/app/api/gateway/sessions/route_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/app/api/gateway/status/route.js +3 -3
- package/.next/standalone/.next/server/app/api/gateway/status/route_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/app/api/openclaw/commands/route_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/app/api/search/route_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/app/api/settings/search-status/route_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/app/api/setup/bootstrap/route_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/app/api/setup/bootstrap-workspace/route_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/app/api/setup/status/route_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/app/api/setup/trigger-onboarding/route.js +3 -3
- package/.next/standalone/.next/server/app/api/setup/trigger-onboarding/route_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/app/api/version/route_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/app/index.html +1 -1
- package/.next/standalone/.next/server/app/index.rsc +1 -1
- package/.next/standalone/.next/server/app/index.segments/__PAGE__.segment.rsc +1 -1
- package/.next/standalone/.next/server/app/index.segments/_full.segment.rsc +1 -1
- package/.next/standalone/.next/server/app/index.segments/_head.segment.rsc +1 -1
- package/.next/standalone/.next/server/app/index.segments/_index.segment.rsc +1 -1
- package/.next/standalone/.next/server/app/index.segments/_tree.segment.rsc +1 -1
- package/.next/standalone/.next/server/app/page_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/app/settings/connection/page_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/app/settings/connection.html +1 -1
- package/.next/standalone/.next/server/app/settings/connection.rsc +1 -1
- package/.next/standalone/.next/server/app/settings/connection.segments/_full.segment.rsc +1 -1
- package/.next/standalone/.next/server/app/settings/connection.segments/_head.segment.rsc +1 -1
- package/.next/standalone/.next/server/app/settings/connection.segments/_index.segment.rsc +1 -1
- package/.next/standalone/.next/server/app/settings/connection.segments/_tree.segment.rsc +1 -1
- package/.next/standalone/.next/server/app/settings/connection.segments/settings/connection/__PAGE__.segment.rsc +1 -1
- package/.next/standalone/.next/server/app/settings/connection.segments/settings/connection.segment.rsc +1 -1
- package/.next/standalone/.next/server/app/settings/connection.segments/settings.segment.rsc +1 -1
- package/.next/standalone/.next/server/app/settings/page_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/app/settings/relay/page_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/app/settings/relay.html +1 -1
- package/.next/standalone/.next/server/app/settings/relay.rsc +1 -1
- package/.next/standalone/.next/server/app/settings/relay.segments/_full.segment.rsc +1 -1
- package/.next/standalone/.next/server/app/settings/relay.segments/_head.segment.rsc +1 -1
- package/.next/standalone/.next/server/app/settings/relay.segments/_index.segment.rsc +1 -1
- package/.next/standalone/.next/server/app/settings/relay.segments/_tree.segment.rsc +1 -1
- package/.next/standalone/.next/server/app/settings/relay.segments/settings/relay/__PAGE__.segment.rsc +1 -1
- package/.next/standalone/.next/server/app/settings/relay.segments/settings/relay.segment.rsc +1 -1
- package/.next/standalone/.next/server/app/settings/relay.segments/settings.segment.rsc +1 -1
- package/.next/standalone/.next/server/app/settings.html +1 -1
- package/.next/standalone/.next/server/app/settings.rsc +1 -1
- package/.next/standalone/.next/server/app/settings.segments/_full.segment.rsc +1 -1
- package/.next/standalone/.next/server/app/settings.segments/_head.segment.rsc +1 -1
- package/.next/standalone/.next/server/app/settings.segments/_index.segment.rsc +1 -1
- package/.next/standalone/.next/server/app/settings.segments/_tree.segment.rsc +1 -1
- package/.next/standalone/.next/server/app/settings.segments/settings/__PAGE__.segment.rsc +1 -1
- package/.next/standalone/.next/server/app/settings.segments/settings.segment.rsc +1 -1
- package/.next/standalone/.next/server/app/setup/page_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/app/setup.html +1 -1
- package/.next/standalone/.next/server/app/setup.rsc +2 -2
- package/.next/standalone/.next/server/app/setup.segments/_full.segment.rsc +2 -2
- package/.next/standalone/.next/server/app/setup.segments/_head.segment.rsc +1 -1
- package/.next/standalone/.next/server/app/setup.segments/_index.segment.rsc +1 -1
- package/.next/standalone/.next/server/app/setup.segments/_tree.segment.rsc +1 -1
- package/.next/standalone/.next/server/app/setup.segments/setup/__PAGE__.segment.rsc +2 -2
- package/.next/standalone/.next/server/app/setup.segments/setup.segment.rsc +1 -1
- package/.next/standalone/.next/server/app/waitlist/page_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/app/waitlist.html +1 -1
- package/.next/standalone/.next/server/app/waitlist.rsc +1 -1
- package/.next/standalone/.next/server/app/waitlist.segments/_full.segment.rsc +1 -1
- package/.next/standalone/.next/server/app/waitlist.segments/_head.segment.rsc +1 -1
- package/.next/standalone/.next/server/app/waitlist.segments/_index.segment.rsc +1 -1
- package/.next/standalone/.next/server/app/waitlist.segments/_tree.segment.rsc +1 -1
- package/.next/standalone/.next/server/app/waitlist.segments/waitlist/__PAGE__.segment.rsc +1 -1
- package/.next/standalone/.next/server/app/waitlist.segments/waitlist.segment.rsc +1 -1
- package/.next/standalone/.next/server/app/workspace/[...path]/page_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/app/workspace/page_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/app/workspace/search/page_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/app/workspace/search.html +2 -2
- package/.next/standalone/.next/server/app/workspace/search.rsc +2 -2
- package/.next/standalone/.next/server/app/workspace/search.segments/_full.segment.rsc +2 -2
- package/.next/standalone/.next/server/app/workspace/search.segments/_head.segment.rsc +1 -1
- package/.next/standalone/.next/server/app/workspace/search.segments/_index.segment.rsc +1 -1
- package/.next/standalone/.next/server/app/workspace/search.segments/_tree.segment.rsc +1 -1
- package/.next/standalone/.next/server/app/workspace/search.segments/workspace/search/__PAGE__.segment.rsc +1 -1
- package/.next/standalone/.next/server/app/workspace/search.segments/workspace/search.segment.rsc +1 -1
- package/.next/standalone/.next/server/app/workspace/search.segments/workspace.segment.rsc +2 -2
- package/.next/standalone/.next/server/app/workspace.html +2 -2
- package/.next/standalone/.next/server/app/workspace.rsc +2 -2
- package/.next/standalone/.next/server/app/workspace.segments/_full.segment.rsc +2 -2
- package/.next/standalone/.next/server/app/workspace.segments/_head.segment.rsc +1 -1
- package/.next/standalone/.next/server/app/workspace.segments/_index.segment.rsc +1 -1
- package/.next/standalone/.next/server/app/workspace.segments/_tree.segment.rsc +1 -1
- package/.next/standalone/.next/server/app/workspace.segments/workspace/__PAGE__.segment.rsc +1 -1
- package/.next/standalone/.next/server/app/workspace.segments/workspace.segment.rsc +2 -2
- package/.next/standalone/.next/server/app-paths-manifest.json +10 -10
- package/.next/standalone/.next/server/chunks/1210.js +2 -2
- package/.next/standalone/.next/server/chunks/2461.js +1 -1
- package/.next/standalone/.next/server/chunks/8349.js +1 -1
- package/.next/standalone/.next/server/chunks/8353.js +1 -1
- package/.next/standalone/.next/server/middleware-build-manifest.js +1 -1
- package/.next/standalone/.next/server/middleware-react-loadable-manifest.js +1 -1
- package/.next/standalone/.next/server/pages/404.html +1 -1
- package/.next/standalone/.next/server/pages/500.html +2 -2
- package/.next/standalone/.next/server/server-reference-manifest.json +1 -1
- package/.next/standalone/node_modules/buffer-from/index.js +72 -0
- package/.next/standalone/node_modules/buffer-from/package.json +19 -0
- package/.next/standalone/node_modules/source-map/lib/array-set.js +121 -0
- package/.next/standalone/node_modules/source-map/lib/base64-vlq.js +140 -0
- package/.next/standalone/node_modules/source-map/lib/base64.js +67 -0
- package/.next/standalone/node_modules/source-map/lib/binary-search.js +111 -0
- package/.next/standalone/node_modules/source-map/lib/mapping-list.js +79 -0
- package/.next/standalone/node_modules/source-map/lib/quick-sort.js +114 -0
- package/.next/standalone/node_modules/source-map/lib/source-map-consumer.js +1145 -0
- package/.next/standalone/node_modules/source-map/lib/source-map-generator.js +425 -0
- package/.next/standalone/node_modules/source-map/lib/source-node.js +413 -0
- package/.next/standalone/node_modules/source-map/lib/util.js +488 -0
- package/.next/standalone/node_modules/source-map/package.json +73 -0
- package/.next/standalone/node_modules/source-map/source-map.js +8 -0
- package/.next/standalone/node_modules/source-map-support/package.json +31 -0
- package/.next/standalone/node_modules/source-map-support/source-map-support.js +625 -0
- package/.next/standalone/package.json +50 -2
- package/.next/static/chunks/1285-5a2da086334493ab.js +9 -0
- package/.next/static/chunks/{6361.30ea8932d09b0d43.js → 6361.4027eebdd6a32ea5.js} +10 -10
- package/.next/static/chunks/{webpack-d35467e84f0e8517.js → webpack-bae8b6e8f6434041.js} +1 -1
- package/bin/clawpad.js +114 -5
- package/desktop/main.mjs +246 -0
- package/package.json +50 -2
- package/.next/static/chunks/1285-4a6c410db884bf7b.js +0 -9
- /package/.next/static/{T15gnrz7Vzb4Fk8oyeO0c → wKlPJe_kS6vhLy0YQ8diN}/_buildManifest.js +0 -0
- /package/.next/static/{T15gnrz7Vzb4Fk8oyeO0c → wKlPJe_kS6vhLy0YQ8diN}/_ssgManifest.js +0 -0
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";exports.id=8349,exports.ids=[8349],exports.modules={18349:(a,b,c)=>{c.d(b,{detectGateway:()=>h});var d=c(79748),e=c(27843),f=c(21642),g=c(69038);async function h(){let a=process.env.OPENCLAW_GATEWAY_URL,b=j(process.env.OPENCLAW_GATEWAY_TOKEN),c=process.env.OPENCLAW_AGENT_NAME;if(a)return{url:i(a),token:b||void 0,agentName:c||void 0,source:"env"};try{let a=await (0,g.r$)();if(a?.url)return{url:i(a.url),token:j(a.token)??b,agentName:c||void 0,source:"clawpad.override"}}catch{}try{let a=(0,e.YJ)();if(a){var h;let c=await (0,d.readFile)(a,"utf-8"),e=(0,f.N)(c),g=e.ok&&e.value&&"object"==typeof e.value?e.value:{},i=g.gateway?.port??g.port??18789,m={loopback:"127.0.0.1",localhost:"127.0.0.1","0.0.0.0":"127.0.0.1","::":"127.0.0.1","::1":"127.0.0.1"}[h=g.gateway?.bind??g.gateway?.host??g.host??"127.0.0.1"]??h;return{url:`http://${m}:${i}`,token:function(a){if(!a||"object"!=typeof a)return;let b=[],c=j(a.token);if(c){let d=k(a.scopes??a.scope);b.push({token:c,score:d.size>0?l(d)+30:50,priority:0})}let d=Array.isArray(a.tokens)?a.tokens:[];for(let a=0;a<d.length;a+=1){let c=d[a],e="string"==typeof c?j(c):c&&"object"==typeof c&&!1!==c.enabled?j(c.token??c.value??c.accessToken??c.access_token??c.bearer??c.secret):void 0;if(!e)continue;let f=c&&"object"==typeof c?k(c.scopes??c.scope):new Set;b.push({token:e,score:f.size>0?l(f):25,priority:a+1})}if(0!==b.length)return b.sort((a,b)=>b.score-a.score||a.priority-b.priority),b[0]?.token}(g.gateway?.auth)??b,agentName:g.name??g.agentName??void 0,source:a.includes("clawdbot.json")?"clawdbot.json":"openclaw.json"}}}catch{}return{url:"http://127.0.0.1:18789",token:void 0,agentName:void 0,source:"default"}}function i(a){return a.startsWith("http://")||a.startsWith("https://")?a.replace(/\/+$/,""):`http://${a}`}function j(a){if("string"==typeof a)return a.trim()||void 0}function k(a){let b=new Set,c=[];if("string"==typeof a)c.push(...a.split(/[,\s]+/g));else if(Array.isArray(a))for(let b of a)"string"==typeof b&&c.push(...b.split(/[,\s]+/g));for(let a of c){let c=a.trim().toLowerCase();c&&b.add(c)}return b}function l(a){return a.has("operator.
|
|
1
|
+
"use strict";exports.id=8349,exports.ids=[8349],exports.modules={18349:(a,b,c)=>{c.d(b,{detectGateway:()=>h});var d=c(79748),e=c(27843),f=c(21642),g=c(69038);async function h(){let a=process.env.OPENCLAW_GATEWAY_URL,b=j(process.env.OPENCLAW_GATEWAY_TOKEN),c=process.env.OPENCLAW_AGENT_NAME;if(a)return{url:i(a),token:b||void 0,agentName:c||void 0,source:"env"};try{let a=await (0,g.r$)();if(a?.url)return{url:i(a.url),token:j(a.token)??b,agentName:c||void 0,source:"clawpad.override"}}catch{}try{let a=(0,e.YJ)();if(a){var h;let c=await (0,d.readFile)(a,"utf-8"),e=(0,f.N)(c),g=e.ok&&e.value&&"object"==typeof e.value?e.value:{},i=g.gateway?.port??g.port??18789,m={loopback:"127.0.0.1",localhost:"127.0.0.1","0.0.0.0":"127.0.0.1","::":"127.0.0.1","::1":"127.0.0.1"}[h=g.gateway?.bind??g.gateway?.host??g.host??"127.0.0.1"]??h;return{url:`http://${m}:${i}`,token:function(a){if(!a||"object"!=typeof a)return;let b=[],c=j(a.token);if(c){let d=k(a.scopes??a.scope);b.push({token:c,score:d.size>0?l(d)+30:50,priority:0})}let d=Array.isArray(a.tokens)?a.tokens:[];for(let a=0;a<d.length;a+=1){let c=d[a],e="string"==typeof c?j(c):c&&"object"==typeof c&&!1!==c.enabled?j(c.token??c.value??c.accessToken??c.access_token??c.bearer??c.secret):void 0;if(!e)continue;let f=c&&"object"==typeof c?k(c.scopes??c.scope):new Set;b.push({token:e,score:f.size>0?l(f):25,priority:a+1})}if(0!==b.length)return b.sort((a,b)=>b.score-a.score||a.priority-b.priority),b[0]?.token}(g.gateway?.auth)??b,agentName:g.name??g.agentName??void 0,source:a.includes("clawdbot.json")?"clawdbot.json":"openclaw.json"}}}catch{}return{url:"http://127.0.0.1:18789",token:void 0,agentName:void 0,source:"default"}}function i(a){return a.startsWith("http://")||a.startsWith("https://")?a.replace(/\/+$/,""):`http://${a}`}function j(a){if("string"==typeof a)return a.trim()||void 0}function k(a){let b=new Set,c=[];if("string"==typeof a)c.push(...a.split(/[,\s]+/g));else if(Array.isArray(a))for(let b of a)"string"==typeof b&&c.push(...b.split(/[,\s]+/g));for(let a of c){let c=a.trim().toLowerCase();c&&b.add(c)}return b}function l(a){let b=10;return a.has("operator.read")&&(b+=100),a.has("operator.write")&&(b+=200),a.has("operator.admin")&&(b+=30),a.has("operator.approvals")&&(b+=5),a.has("operator.pairing")&&(b+=5),b}},69038:(a,b,c)=>{c.d(b,{I3:()=>n,ij:()=>m,r$:()=>l});var d=c(79748),e=c.n(d),f=c(33873),g=c.n(f),h=c(27843);function i(a){if("string"!=typeof a)return null;let b=a.trim();return b?(b.startsWith("http://")||b.startsWith("https://")?b:`http://${b}`).replace(/\/+$/g,""):null}function j(a){if("string"==typeof a)return a.trim()||void 0}function k(a=process.env){return g().join((0,h.We)(a),"clawpad","gateway-override.json")}async function l(a=process.env){let b=k(a);try{let a=await e().readFile(b,"utf-8"),c=JSON.parse(a),d=i(c?.url);if(c?.version!==1||!d)return null;let f=j(c?.token),g="string"==typeof c?.updatedAt&&c.updatedAt.trim()?c.updatedAt:new Date().toISOString();return{version:1,url:d,...f?{token:f}:{},updatedAt:g}}catch{return null}}async function m(a,b=process.env){let c=i(a.url);if(!c)throw Error("Gateway URL is required");let d=j(a.token),f={version:1,url:c,...d?{token:d}:{},updatedAt:new Date().toISOString()},h=k(b);await e().mkdir(g().dirname(h),{recursive:!0}),await e().writeFile(h,`${JSON.stringify(f,null,2)}
|
|
2
2
|
`,{mode:384});try{await e().chmod(h,384)}catch{}return f}async function n(a=process.env){let b=k(a);try{await e().unlink(b)}catch{}}}};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
exports.id=8353,exports.ids=[8349,8353],exports.modules={18349:(a,b,c)=>{"use strict";c.d(b,{detectGateway:()=>h});var d=c(79748),e=c(27843),f=c(21642),g=c(69038);async function h(){let a=process.env.OPENCLAW_GATEWAY_URL,b=k(process.env.OPENCLAW_GATEWAY_TOKEN),c=process.env.OPENCLAW_AGENT_NAME;if(a)return{url:j(a),token:b||void 0,agentName:c||void 0,source:"env"};try{let a=await (0,g.r$)();if(a?.url)return{url:j(a.url),token:k(a.token)??b,agentName:c||void 0,source:"clawpad.override"}}catch{}try{let a=(0,e.YJ)();if(a){let c=await (0,d.readFile)(a,"utf-8"),e=(0,f.N)(c),g=e.ok&&e.value&&"object"==typeof e.value?e.value:{},h=g.gateway?.port??g.port??18789,j=i(g.gateway?.bind??g.gateway?.host??g.host??"127.0.0.1");return{url:`http://${j}:${h}`,token:o(g.gateway?.auth)??b,agentName:g.name??g.agentName??void 0,source:a.includes("clawdbot.json")?"clawdbot.json":"openclaw.json"}}}catch{}return{url:"http://127.0.0.1:18789",token:void 0,agentName:void 0,source:"default"}}function i(a){return({loopback:"127.0.0.1",localhost:"127.0.0.1","0.0.0.0":"127.0.0.1","::":"127.0.0.1","::1":"127.0.0.1"})[a]??a}function j(a){return a.startsWith("http://")||a.startsWith("https://")?a.replace(/\/+$/,""):`http://${a}`}function k(a){if("string"==typeof a)return a.trim()||void 0}function l(a){let b=new Set,c=[];if("string"==typeof a)c.push(...a.split(/[,\s]+/g));else if(Array.isArray(a))for(let b of a)"string"==typeof b&&c.push(...b.split(/[,\s]+/g));for(let a of c){let c=a.trim().toLowerCase();c&&b.add(c)}return b}function m(a){return a.has("operator.
|
|
1
|
+
exports.id=8353,exports.ids=[8349,8353],exports.modules={18349:(a,b,c)=>{"use strict";c.d(b,{detectGateway:()=>h});var d=c(79748),e=c(27843),f=c(21642),g=c(69038);async function h(){let a=process.env.OPENCLAW_GATEWAY_URL,b=k(process.env.OPENCLAW_GATEWAY_TOKEN),c=process.env.OPENCLAW_AGENT_NAME;if(a)return{url:j(a),token:b||void 0,agentName:c||void 0,source:"env"};try{let a=await (0,g.r$)();if(a?.url)return{url:j(a.url),token:k(a.token)??b,agentName:c||void 0,source:"clawpad.override"}}catch{}try{let a=(0,e.YJ)();if(a){let c=await (0,d.readFile)(a,"utf-8"),e=(0,f.N)(c),g=e.ok&&e.value&&"object"==typeof e.value?e.value:{},h=g.gateway?.port??g.port??18789,j=i(g.gateway?.bind??g.gateway?.host??g.host??"127.0.0.1");return{url:`http://${j}:${h}`,token:o(g.gateway?.auth)??b,agentName:g.name??g.agentName??void 0,source:a.includes("clawdbot.json")?"clawdbot.json":"openclaw.json"}}}catch{}return{url:"http://127.0.0.1:18789",token:void 0,agentName:void 0,source:"default"}}function i(a){return({loopback:"127.0.0.1",localhost:"127.0.0.1","0.0.0.0":"127.0.0.1","::":"127.0.0.1","::1":"127.0.0.1"})[a]??a}function j(a){return a.startsWith("http://")||a.startsWith("https://")?a.replace(/\/+$/,""):`http://${a}`}function k(a){if("string"==typeof a)return a.trim()||void 0}function l(a){let b=new Set,c=[];if("string"==typeof a)c.push(...a.split(/[,\s]+/g));else if(Array.isArray(a))for(let b of a)"string"==typeof b&&c.push(...b.split(/[,\s]+/g));for(let a of c){let c=a.trim().toLowerCase();c&&b.add(c)}return b}function m(a){let b=10;return a.has("operator.read")&&(b+=100),a.has("operator.write")&&(b+=200),a.has("operator.admin")&&(b+=30),a.has("operator.approvals")&&(b+=5),a.has("operator.pairing")&&(b+=5),b}function n(a){if("string"==typeof a)return k(a);if(!a||"object"!=typeof a)return;let b=a;if(!1!==b.enabled)return k(b.token??b.value??b.accessToken??b.access_token??b.bearer??b.secret)}function o(a){if(!a||"object"!=typeof a)return;let b=a,c=[],d=k(b.token);if(d){let a=l(b.scopes??b.scope);c.push({token:d,score:a.size>0?m(a)+30:50,priority:0})}let e=Array.isArray(b.tokens)?b.tokens:[];for(let a=0;a<e.length;a+=1){let b=e[a],d=n(b);if(!d)continue;let f=b&&"object"==typeof b?l(b.scopes??b.scope):new Set;c.push({token:d,score:f.size>0?m(f):25,priority:a+1})}if(0!==c.length)return c.sort((a,b)=>b.score-a.score||a.priority-b.priority),c[0]?.token}},21642:(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{"use strict";function loadOptionalJson5(){try{let req=eval("require"),mod=req("json5");if(mod&&"function"==typeof mod.parse)return mod}catch{}return null}function stripComments(a){let b="",c=!1,d="",e=!1,f=!1,g=!1;for(let h=0;h<a.length;h+=1){let i=a[h],j=a[h+1];if(e){"\n"===i&&(e=!1,b+=i);continue}if(f){"*"===i&&"/"===j&&(f=!1,h+=1);continue}if(c){if(b+=i,g){g=!1;continue}if("\\"===i){g=!0;continue}i===d&&(c=!1,d="");continue}if('"'===i||"'"===i){c=!0,d=i,b+=i;continue}if("/"===i&&"/"===j){e=!0,h+=1;continue}if("/"===i&&"*"===j){f=!0,h+=1;continue}b+=i}return b}function stripTrailingCommas(a){let b="",c=!1,d="",e=!1;for(let f=0;f<a.length;f+=1){let g=a[f];if(c){if(b+=g,e){e=!1;continue}if("\\"===g){e=!0;continue}g===d&&(c=!1,d="");continue}if('"'===g||"'"===g){c=!0,d=g,b+=g;continue}if(","===g){let b=f+1;for(;b<a.length&&/\s/.test(a[b]);)b+=1;let c=a[b];if("}"===c||"]"===c)continue}b+=g}return b}function parseJsonFallback(a){try{return{ok:!0,value:JSON.parse(a)}}catch{}try{let b=stripTrailingCommas(stripComments(a));return{ok:!0,value:JSON.parse(b)}}catch(a){return{ok:!1,error:a instanceof Error?a.message:String(a)}}}function parseOpenClawConfig(a){let b=loadOptionalJson5();if(b)try{return{ok:!0,value:b.parse(a)}}catch{}return parseJsonFallback(a)}__webpack_require__.d(__webpack_exports__,{N:()=>parseOpenClawConfig})},27843:(a,b,c)=>{"use strict";c.d(b,{We:()=>p,YJ:()=>q,l5:()=>r});var d=c(29021),e=c.n(d),f=c(33873),g=c.n(f),h=c(21820),i=c.n(h),j=c(21642);let k=[".clawdbot"],l=["openclaw.json","clawdbot.json"];function m(a=process.env){return[...new Set([a.APPDATA?g().join(a.APPDATA,"OpenClaw"):null,a.APPDATA?g().join(a.APPDATA,"openclaw"):null,a.LOCALAPPDATA?g().join(a.LOCALAPPDATA,"OpenClaw"):null,a.LOCALAPPDATA?g().join(a.LOCALAPPDATA,"openclaw"):null,g().join(i().homedir(),"AppData","Roaming","OpenClaw"),g().join(i().homedir(),"AppData","Roaming","openclaw")].filter(a=>!!(a&&a.trim())).map(a=>g().resolve(a)))]}function n(a){let b=a.trim();return b?b.startsWith("~")?g().resolve(b.replace(/^~(?=$|[\\/])/,i().homedir())):g().resolve(b):b}function o(a){try{return e().existsSync(a)}catch{return!1}}function p(a=process.env){let b=a.OPENCLAW_STATE_DIR||a.CLAWDBOT_STATE_DIR;if(b&&b.trim())return n(b);if("win32"===process.platform){let b=m(a).find(a=>o(a));if(b)return b}return g().join(i().homedir(),".openclaw")}function q(a=process.env){let b=a.OPENCLAW_CONFIG_PATH||a.CLAWDBOT_CONFIG_PATH;if(b&&b.trim()){let a=n(b);return o(a)?a:null}let c=p(a),d="win32"===process.platform?m(a):[];for(let a of[...l.map(a=>g().join(c,a)),...d.flatMap(a=>l.map(b=>g().join(a,b))),g().join(i().homedir(),".openclaw","openclaw.json"),...k.map(a=>g().join(i().homedir(),a,"clawdbot.json"))])if(o(a))return a;return null}function r(a=process.env){let b=q(a);if(!b)return{path:null,config:null};try{let a=e().readFileSync(b,"utf-8"),c=(0,j.N)(a);if(c.ok&&c.value&&"object"==typeof c.value)return{path:b,config:c.value}}catch{}return{path:b,config:null}}},48421:(a,b,c)=>{"use strict";c.a(a,async(a,d)=>{try{c.d(b,{A:()=>j});var e=c(56220),f=c(18349),g=c(94615),h=a([e]);function i(a){if(!a)return null;let b=a.replace(/^ws/i,"http");try{return new URL(b).origin}catch{return null}}async function j(a){let b=await (0,f.detectGateway)();if(!b)throw Error("No gateway configuration found");let c=b.url.replace(/^http/,"ws"),d=i(b.url),h=a.timeoutMs??1e4,j="operator",k=["operator.read","operator.write","operator.admin"],l=(0,g.aZ)(),m=(0,g.vM)({deviceId:l.deviceId,role:j,gatewayUrl:b.url,requiredScopes:g.qq})?.token,n="string"==typeof b.token&&b.token.trim()?b.token.trim():void 0;class o extends Error{}let p=[];m&&p.push({token:m,source:"stored"}),m&&m===n||p.push({token:n,source:"config"}),0===p.length&&p.push({token:void 0,source:"config"});let q=async(f,i)=>new Promise((m,n)=>{let p,q=0,r=!1,s=setTimeout(()=>{if(!r){r=!0;try{p?.close()}catch{}n(Error("Gateway request timed out"))}},h);function t(a,b){if(!r){r=!0,clearTimeout(s);try{p?.close()}catch{}a?n(a):m(b)}}try{p=new e.default(c,d?{origin:d}:void 0)}catch(a){clearTimeout(s),n(Error(`Failed to create WebSocket: ${a}`));return}p.on("close",()=>{t(Error("WebSocket closed before response"))}),p.on("error",a=>{t(Error(`WebSocket error: ${a.message}`))}),p.on("message",c=>{let d;try{d=JSON.parse(String(c))}catch{return}if("event"===d.type&&"connect.challenge"===d.event){let a=d.payload&&"object"==typeof d.payload?d.payload:void 0,b="string"==typeof a?.nonce?a.nonce:void 0,c=(0,g.n3)({identity:l,clientId:"webchat-ui",clientMode:"webchat",role:j,scopes:k,token:f,nonce:b}),e={type:"req",id:String(++q),method:"connect",params:{minProtocol:3,maxProtocol:3,client:{id:"webchat-ui",version:"clawpad",platform:"web",mode:"webchat"},role:j,scopes:k,caps:[],commands:[],permissions:{},auth:f?{token:f}:{},device:c}};p.send(JSON.stringify(e));return}if("res"===d.type&&d.id===String(q)&&1===q){if(!d.ok)return void t(Error(`Gateway connect rejected: ${JSON.stringify(d.error)}`));let c=d.payload&&"object"==typeof d.payload?d.payload:void 0,e="string"==typeof c?.auth?.deviceToken?c.auth.deviceToken:null,f="string"==typeof c?.auth?.role?c.auth.role:j,h=Array.isArray(c?.auth?.scopes)?c.auth.scopes.filter(a=>"string"==typeof a):[],k=!(h.length>0)||(0,g.PP)(h,g.qq);if(e&&k&&(0,g.HQ)({deviceId:l.deviceId,role:f,token:e,scopes:h,gatewayUrl:b.url}),!k){let a=new Set(h.map(a=>a.toLowerCase()));(0,g.Sm)({deviceId:l.deviceId,role:f,gatewayUrl:b.url,includeLegacyRoleEntry:!0});let c=g.qq.filter(b=>!a.has(b)),d=`Gateway connect rejected: missing scope(s) ${c.join(", ")||"unknown"}. Run \`openclaw doctor --generate-gateway-token\`, \`openclaw gateway restart\`, then restart ClawPad.`;"stored"===i?t(new o(d)):t(Error(d));return}let m={type:"req",id:String(++q),method:a.method,params:a.params??{}};return void p.send(JSON.stringify(m))}if("res"===d.type&&d.id===String(q)&&2===q)return d.ok?void t(null,d.payload):void t(Error(`Gateway RPC error: ${JSON.stringify(d.error)}`))})}),r=null;for(let a of p)try{return await q(a.token,a.source)}catch(a){if(a instanceof o){r=a;continue}r=a instanceof Error?a:Error(String(a));break}throw r??Error("Gateway request failed")}e=(h.then?(await h)():h)[0],d()}catch(a){d(a)}})},69038:(a,b,c)=>{"use strict";c.d(b,{I3:()=>n,ij:()=>m,r$:()=>l});var d=c(79748),e=c.n(d),f=c(33873),g=c.n(f),h=c(27843);function i(a){if("string"!=typeof a)return null;let b=a.trim();return b?(b.startsWith("http://")||b.startsWith("https://")?b:`http://${b}`).replace(/\/+$/g,""):null}function j(a){if("string"==typeof a)return a.trim()||void 0}function k(a=process.env){return g().join((0,h.We)(a),"clawpad","gateway-override.json")}async function l(a=process.env){let b=k(a);try{let a=await e().readFile(b,"utf-8"),c=JSON.parse(a),d=i(c?.url);if(c?.version!==1||!d)return null;let f=j(c?.token),g="string"==typeof c?.updatedAt&&c.updatedAt.trim()?c.updatedAt:new Date().toISOString();return{version:1,url:d,...f?{token:f}:{},updatedAt:g}}catch{return null}}async function m(a,b=process.env){let c=i(a.url);if(!c)throw Error("Gateway URL is required");let d=j(a.token),f={version:1,url:c,...d?{token:d}:{},updatedAt:new Date().toISOString()},h=k(b);await e().mkdir(g().dirname(h),{recursive:!0}),await e().writeFile(h,`${JSON.stringify(f,null,2)}
|
|
2
2
|
`,{mode:384});try{await e().chmod(h,384)}catch{}return f}async function n(a=process.env){let b=k(a);try{await e().unlink(b)}catch{}}},78335:()=>{},96487:()=>{}};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
globalThis.__BUILD_MANIFEST={polyfillFiles:["static/chunks/polyfills-42372ed130431b0a.js"],devFiles:[],lowPriorityFiles:[],rootMainFiles:["static/chunks/webpack-
|
|
1
|
+
globalThis.__BUILD_MANIFEST={polyfillFiles:["static/chunks/polyfills-42372ed130431b0a.js"],devFiles:[],lowPriorityFiles:[],rootMainFiles:["static/chunks/webpack-bae8b6e8f6434041.js","static/chunks/4bd1b696-e5d7c65570c947b7.js","static/chunks/3794-337d1ca25ad99a89.js","static/chunks/main-app-a1f34f01f7efbb58.js"],rootMainFilesTree:{},pages:{"/_app":[]}},globalThis.__BUILD_MANIFEST.lowPriorityFiles=["/static/"+process.env.__NEXT_BUILD_ID+"/_buildManifest.js","/static/"+process.env.__NEXT_BUILD_ID+"/_ssgManifest.js"];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
self.__REACT_LOADABLE_MANIFEST='{"../node_modules/@blocknote/core/dist/extensions.js -> @emoji-mart/data":{"id":21263,"files":["static/chunks/76567b6f.f10e15270bb8b0cf.js"]},"../node_modules/@blocknote/core/dist/extensions.js -> emoji-mart":{"id":69850,"files":["static/chunks/c0e397d0.4d79f4a4fe21a0b3.js"]},"../node_modules/@blocknote/react/dist/blocknote-react.js -> @emoji-mart/data":{"id":21263,"files":["static/chunks/76567b6f.f10e15270bb8b0cf.js"]},"../node_modules/@blocknote/react/dist/blocknote-react.js -> emoji-mart":{"id":69850,"files":["static/chunks/c0e397d0.4d79f4a4fe21a0b3.js"]},"components/editor/page-editor.tsx -> @/components/editor/editor":{"id":3678,"files":["static/css/d37476854e9e226d.css","static/css/df8c8bd97929f65b.css","static/css/d64754055f7202fb.css","static/chunks/6be7e44c.8771fa8ed0278196.js","static/chunks/70e0d97a.6903b8594c742784.js","static/chunks/54a60aa6.867b5520f2f42695.js","static/chunks/c16f53c3.52cb4e268737986f.js","static/chunks/0cc5eebf.810e51166712a4fc.js","static/chunks/9352-dcb425f6cf5347f4.js","static/chunks/6361.
|
|
1
|
+
self.__REACT_LOADABLE_MANIFEST='{"../node_modules/@blocknote/core/dist/extensions.js -> @emoji-mart/data":{"id":21263,"files":["static/chunks/76567b6f.f10e15270bb8b0cf.js"]},"../node_modules/@blocknote/core/dist/extensions.js -> emoji-mart":{"id":69850,"files":["static/chunks/c0e397d0.4d79f4a4fe21a0b3.js"]},"../node_modules/@blocknote/react/dist/blocknote-react.js -> @emoji-mart/data":{"id":21263,"files":["static/chunks/76567b6f.f10e15270bb8b0cf.js"]},"../node_modules/@blocknote/react/dist/blocknote-react.js -> emoji-mart":{"id":69850,"files":["static/chunks/c0e397d0.4d79f4a4fe21a0b3.js"]},"components/editor/page-editor.tsx -> @/components/editor/editor":{"id":3678,"files":["static/css/d37476854e9e226d.css","static/css/df8c8bd97929f65b.css","static/css/d64754055f7202fb.css","static/chunks/6be7e44c.8771fa8ed0278196.js","static/chunks/70e0d97a.6903b8594c742784.js","static/chunks/54a60aa6.867b5520f2f42695.js","static/chunks/c16f53c3.52cb4e268737986f.js","static/chunks/0cc5eebf.810e51166712a4fc.js","static/chunks/9352-dcb425f6cf5347f4.js","static/chunks/6361.4027eebdd6a32ea5.js","static/chunks/3678.620cb571eead466f.js"]}}';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
<!DOCTYPE html><!--
|
|
1
|
+
<!DOCTYPE html><!--wKlPJe_kS6vhLy0YQ8diN--><html lang="en" class="__variable_245d8d __variable_97c177"><head><meta charSet="utf-8"/><meta name="viewport" content="width=device-width, initial-scale=1"/><link rel="preload" href="/_next/static/media/27834908180db20f-s.p.woff2" as="font" crossorigin="" type="font/woff2"/><link rel="preload" href="/_next/static/media/78fec81b34c4a365.p.woff2" as="font" crossorigin="" type="font/woff2"/><link rel="stylesheet" href="/_next/static/css/a6a6c7db5d43079b.css" data-precedence="next"/><link rel="stylesheet" href="/_next/static/css/b5d2bd8e17641061.css" data-precedence="next"/><link rel="preload" as="script" fetchPriority="low" href="/_next/static/chunks/webpack-bae8b6e8f6434041.js"/><script src="/_next/static/chunks/4bd1b696-e5d7c65570c947b7.js" async=""></script><script src="/_next/static/chunks/3794-337d1ca25ad99a89.js" async=""></script><script src="/_next/static/chunks/main-app-a1f34f01f7efbb58.js" async=""></script><script src="/_next/static/chunks/330-60f33582af3e15a5.js" async=""></script><script src="/_next/static/chunks/7300-9984bd6aa378227a.js" async=""></script><script src="/_next/static/chunks/6609-078a8cdc853f87c6.js" async=""></script><script src="/_next/static/chunks/8935-b62f5c8bf50ff5e8.js" async=""></script><script src="/_next/static/chunks/112-8da50d6fab374e89.js" async=""></script><script src="/_next/static/chunks/1178-f2f0bd687a63b9f8.js" async=""></script><script src="/_next/static/chunks/app/layout-6fad2f96726e757a.js" async=""></script><meta name="robots" content="noindex"/><meta name="next-size-adjust" content=""/><title>404: This page could not be found.</title><title>ClawPad</title><meta name="description" content="The workspace for OpenClaw"/><link rel="icon" href="/favicon.ico?50c20623341a5f1c" type="image/x-icon" sizes="256x256"/><link rel="icon" href="/favicon.ico"/><link rel="icon" href="/favicon.png" type="image/png"/><link rel="apple-touch-icon" href="/brand/apple-touch-icon.png"/><script src="/_next/static/chunks/polyfills-42372ed130431b0a.js" noModule=""></script></head><body class="font-sans antialiased"><div hidden=""><!--$--><!--/$--></div><script>((a,b,c,d,e,f,g,h)=>{let i=document.documentElement,j=["light","dark"];function k(b){var c;(Array.isArray(a)?a:[a]).forEach(a=>{let c="class"===a,d=c&&f?e.map(a=>f[a]||a):e;c?(i.classList.remove(...d),i.classList.add(f&&f[b]?f[b]:b)):i.setAttribute(a,b)}),c=b,h&&j.includes(c)&&(i.style.colorScheme=c)}if(d)k(d);else try{let a=localStorage.getItem(b)||c,d=g&&"system"===a?window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light":a;k(d)}catch(a){}})("class","theme","system",null,["light","dark"],null,true,true)</script><div style="font-family:system-ui,"Segoe UI",Roboto,Helvetica,Arial,sans-serif,"Apple Color Emoji","Segoe UI Emoji";height:100vh;text-align:center;display:flex;flex-direction:column;align-items:center;justify-content:center"><div><style>body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}</style><h1 class="next-error-h1" style="display:inline-block;margin:0 20px 0 0;padding:0 23px 0 0;font-size:24px;font-weight:500;vertical-align:top;line-height:49px">404</h1><div style="display:inline-block"><h2 style="font-size:14px;font-weight:400;line-height:49px;margin:0">This page could not be found.</h2></div></div></div><!--$--><!--/$--><section aria-label="Notifications alt+T" tabindex="-1" aria-live="polite" aria-relevant="additions text" aria-atomic="false"></section><script src="/_next/static/chunks/webpack-bae8b6e8f6434041.js" id="_R_" async=""></script><script>(self.__next_f=self.__next_f||[]).push([0])</script><script>self.__next_f.push([1,"1:\"$Sreact.fragment\"\n2:I[37279,[\"330\",\"static/chunks/330-60f33582af3e15a5.js\",\"7300\",\"static/chunks/7300-9984bd6aa378227a.js\",\"6609\",\"static/chunks/6609-078a8cdc853f87c6.js\",\"8935\",\"static/chunks/8935-b62f5c8bf50ff5e8.js\",\"112\",\"static/chunks/112-8da50d6fab374e89.js\",\"1178\",\"static/chunks/1178-f2f0bd687a63b9f8.js\",\"7177\",\"static/chunks/app/layout-6fad2f96726e757a.js\"],\"Providers\"]\n3:I[57121,[],\"\"]\n4:I[74581,[],\"\"]\n5:I[25044,[\"330\",\"static/chunks/330-60f33582af3e15a5.js\",\"7300\",\"static/chunks/7300-9984bd6aa378227a.js\",\"6609\",\"static/chunks/6609-078a8cdc853f87c6.js\",\"8935\",\"static/chunks/8935-b62f5c8bf50ff5e8.js\",\"112\",\"static/chunks/112-8da50d6fab374e89.js\",\"1178\",\"static/chunks/1178-f2f0bd687a63b9f8.js\",\"7177\",\"static/chunks/app/layout-6fad2f96726e757a.js\"],\"Toaster\"]\n6:I[90484,[],\"OutletBoundary\"]\n7:\"$Sreact.suspense\"\n9:I[90484,[],\"ViewportBoundary\"]\nb:I[90484,[],\"MetadataBoundary\"]\nd:I[27123,[],\"\"]\n:HL[\"/_next/static/media/27834908180db20f-s.p.woff2\",\"font\",{\"crossOrigin\":\"\",\"type\":\"font/woff2\"}]\n:HL[\"/_next/static/media/78fec81b34c4a365.p.woff2\",\"font\",{\"crossOrigin\":\"\",\"type\":\"font/woff2\"}]\n:HL[\"/_next/static/css/a6a6c7db5d43079b.css\",\"style\"]\n:HL[\"/_next/static/css/b5d2bd8e17641061.css\",\"style\"]\n"])</script><script>self.__next_f.push([1,"0:{\"P\":null,\"b\":\"wKlPJe_kS6vhLy0YQ8diN\",\"c\":[\"\",\"_not-found\"],\"q\":\"\",\"i\":false,\"f\":[[[\"\",{\"children\":[\"_not-found\",{\"children\":[\"__PAGE__\",{}]}]},\"$undefined\",\"$undefined\",true],[[\"$\",\"$1\",\"c\",{\"children\":[[[\"$\",\"link\",\"0\",{\"rel\":\"stylesheet\",\"href\":\"/_next/static/css/a6a6c7db5d43079b.css\",\"precedence\":\"next\",\"crossOrigin\":\"$undefined\",\"nonce\":\"$undefined\"}],[\"$\",\"link\",\"1\",{\"rel\":\"stylesheet\",\"href\":\"/_next/static/css/b5d2bd8e17641061.css\",\"precedence\":\"next\",\"crossOrigin\":\"$undefined\",\"nonce\":\"$undefined\"}]],[\"$\",\"html\",null,{\"lang\":\"en\",\"suppressHydrationWarning\":true,\"className\":\"__variable_245d8d __variable_97c177\",\"children\":[\"$\",\"body\",null,{\"className\":\"font-sans antialiased\",\"children\":[\"$\",\"$L2\",null,{\"children\":[[\"$\",\"$L3\",null,{\"parallelRouterKey\":\"children\",\"error\":\"$undefined\",\"errorStyles\":\"$undefined\",\"errorScripts\":\"$undefined\",\"template\":[\"$\",\"$L4\",null,{}],\"templateStyles\":\"$undefined\",\"templateScripts\":\"$undefined\",\"notFound\":\"$undefined\",\"forbidden\":\"$undefined\",\"unauthorized\":\"$undefined\"}],[\"$\",\"$L5\",null,{}]]}]}]}]]}],{\"children\":[[\"$\",\"$1\",\"c\",{\"children\":[null,[\"$\",\"$L3\",null,{\"parallelRouterKey\":\"children\",\"error\":\"$undefined\",\"errorStyles\":\"$undefined\",\"errorScripts\":\"$undefined\",\"template\":[\"$\",\"$L4\",null,{}],\"templateStyles\":\"$undefined\",\"templateScripts\":\"$undefined\",\"notFound\":\"$undefined\",\"forbidden\":\"$undefined\",\"unauthorized\":\"$undefined\"}]]}],{\"children\":[[\"$\",\"$1\",\"c\",{\"children\":[[[\"$\",\"title\",null,{\"children\":\"404: This page could not be found.\"}],[\"$\",\"div\",null,{\"style\":{\"fontFamily\":\"system-ui,\\\"Segoe UI\\\",Roboto,Helvetica,Arial,sans-serif,\\\"Apple Color Emoji\\\",\\\"Segoe UI Emoji\\\"\",\"height\":\"100vh\",\"textAlign\":\"center\",\"display\":\"flex\",\"flexDirection\":\"column\",\"alignItems\":\"center\",\"justifyContent\":\"center\"},\"children\":[\"$\",\"div\",null,{\"children\":[[\"$\",\"style\",null,{\"dangerouslySetInnerHTML\":{\"__html\":\"body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}\"}}],[\"$\",\"h1\",null,{\"className\":\"next-error-h1\",\"style\":{\"display\":\"inline-block\",\"margin\":\"0 20px 0 0\",\"padding\":\"0 23px 0 0\",\"fontSize\":24,\"fontWeight\":500,\"verticalAlign\":\"top\",\"lineHeight\":\"49px\"},\"children\":404}],[\"$\",\"div\",null,{\"style\":{\"display\":\"inline-block\"},\"children\":[\"$\",\"h2\",null,{\"style\":{\"fontSize\":14,\"fontWeight\":400,\"lineHeight\":\"49px\",\"margin\":0},\"children\":\"This page could not be found.\"}]}]]}]}]],null,[\"$\",\"$L6\",null,{\"children\":[\"$\",\"$7\",null,{\"name\":\"Next.MetadataOutlet\",\"children\":\"$@8\"}]}]]}],{},null,false,false]},null,false,false]},null,false,false],[\"$\",\"$1\",\"h\",{\"children\":[[\"$\",\"meta\",null,{\"name\":\"robots\",\"content\":\"noindex\"}],[\"$\",\"$L9\",null,{\"children\":\"$La\"}],[\"$\",\"div\",null,{\"hidden\":true,\"children\":[\"$\",\"$Lb\",null,{\"children\":[\"$\",\"$7\",null,{\"name\":\"Next.Metadata\",\"children\":\"$Lc\"}]}]}],[\"$\",\"meta\",null,{\"name\":\"next-size-adjust\",\"content\":\"\"}]]}],false]],\"m\":\"$undefined\",\"G\":[\"$d\",[]],\"S\":true}\n"])</script><script>self.__next_f.push([1,"a:[[\"$\",\"meta\",\"0\",{\"charSet\":\"utf-8\"}],[\"$\",\"meta\",\"1\",{\"name\":\"viewport\",\"content\":\"width=device-width, initial-scale=1\"}]]\n"])</script><script>self.__next_f.push([1,"e:I[86869,[],\"IconMark\"]\n8:null\nc:[[\"$\",\"title\",\"0\",{\"children\":\"ClawPad\"}],[\"$\",\"meta\",\"1\",{\"name\":\"description\",\"content\":\"The workspace for OpenClaw\"}],[\"$\",\"link\",\"2\",{\"rel\":\"icon\",\"href\":\"/favicon.ico?50c20623341a5f1c\",\"type\":\"image/x-icon\",\"sizes\":\"256x256\"}],[\"$\",\"link\",\"3\",{\"rel\":\"icon\",\"href\":\"/favicon.ico\"}],[\"$\",\"link\",\"4\",{\"rel\":\"icon\",\"href\":\"/favicon.png\",\"type\":\"image/png\"}],[\"$\",\"link\",\"5\",{\"rel\":\"apple-touch-icon\",\"href\":\"/brand/apple-touch-icon.png\"}],[\"$\",\"$Le\",\"6\",{}]]\n"])</script></body></html>
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
<!DOCTYPE html><!--
|
|
2
|
-
@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}</style><h1 class="next-error-h1" style="display:inline-block;margin:0 20px 0 0;padding-right:23px;font-size:24px;font-weight:500;vertical-align:top">500</h1><div style="display:inline-block"><h2 style="font-size:14px;font-weight:400;line-height:28px">Internal Server Error.</h2></div></div></div><!--$--><!--/$--><script src="/_next/static/chunks/webpack-
|
|
1
|
+
<!DOCTYPE html><!--wKlPJe_kS6vhLy0YQ8diN--><html id="__next_error__"><head><meta charSet="utf-8"/><meta name="viewport" content="width=device-width, initial-scale=1"/><link rel="preload" as="script" fetchPriority="low" href="/_next/static/chunks/webpack-bae8b6e8f6434041.js"/><script src="/_next/static/chunks/4bd1b696-e5d7c65570c947b7.js" async=""></script><script src="/_next/static/chunks/3794-337d1ca25ad99a89.js" async=""></script><script src="/_next/static/chunks/main-app-a1f34f01f7efbb58.js" async=""></script><meta name="next-size-adjust" content=""/><title>500: Internal Server Error.</title><script src="/_next/static/chunks/polyfills-42372ed130431b0a.js" noModule=""></script></head><body><div hidden=""><!--$--><!--/$--></div><div style="font-family:system-ui,"Segoe UI",Roboto,Helvetica,Arial,sans-serif,"Apple Color Emoji","Segoe UI Emoji";height:100vh;text-align:center;display:flex;flex-direction:column;align-items:center;justify-content:center"><div style="line-height:48px"><style>body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}
|
|
2
|
+
@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}</style><h1 class="next-error-h1" style="display:inline-block;margin:0 20px 0 0;padding-right:23px;font-size:24px;font-weight:500;vertical-align:top">500</h1><div style="display:inline-block"><h2 style="font-size:14px;font-weight:400;line-height:28px">Internal Server Error.</h2></div></div></div><!--$--><!--/$--><script src="/_next/static/chunks/webpack-bae8b6e8f6434041.js" id="_R_" async=""></script><script>(self.__next_f=self.__next_f||[]).push([0])</script><script>self.__next_f.push([1,"1:\"$Sreact.fragment\"\n2:I[57121,[],\"\"]\n3:I[74581,[],\"\"]\n4:I[90484,[],\"OutletBoundary\"]\n5:\"$Sreact.suspense\"\n7:I[90484,[],\"ViewportBoundary\"]\n9:I[90484,[],\"MetadataBoundary\"]\nb:I[27123,[],\"\"]\n"])</script><script>self.__next_f.push([1,"0:{\"P\":null,\"b\":\"wKlPJe_kS6vhLy0YQ8diN\",\"c\":[\"\",\"_global-error\"],\"q\":\"\",\"i\":false,\"f\":[[[\"\",{\"children\":[\"_global-error\",{\"children\":[\"__PAGE__\",{}]}]}],[[\"$\",\"$1\",\"c\",{\"children\":[null,[\"$\",\"$L2\",null,{\"parallelRouterKey\":\"children\",\"error\":\"$undefined\",\"errorStyles\":\"$undefined\",\"errorScripts\":\"$undefined\",\"template\":[\"$\",\"$L3\",null,{}],\"templateStyles\":\"$undefined\",\"templateScripts\":\"$undefined\",\"notFound\":\"$undefined\",\"forbidden\":\"$undefined\",\"unauthorized\":\"$undefined\"}]]}],{\"children\":[[\"$\",\"$1\",\"c\",{\"children\":[null,[\"$\",\"$L2\",null,{\"parallelRouterKey\":\"children\",\"error\":\"$undefined\",\"errorStyles\":\"$undefined\",\"errorScripts\":\"$undefined\",\"template\":[\"$\",\"$L3\",null,{}],\"templateStyles\":\"$undefined\",\"templateScripts\":\"$undefined\",\"notFound\":\"$undefined\",\"forbidden\":\"$undefined\",\"unauthorized\":\"$undefined\"}]]}],{\"children\":[[\"$\",\"$1\",\"c\",{\"children\":[[\"$\",\"html\",null,{\"id\":\"__next_error__\",\"children\":[[\"$\",\"head\",null,{\"children\":[\"$\",\"title\",null,{\"children\":\"500: Internal Server Error.\"}]}],[\"$\",\"body\",null,{\"children\":[\"$\",\"div\",null,{\"style\":{\"fontFamily\":\"system-ui,\\\"Segoe UI\\\",Roboto,Helvetica,Arial,sans-serif,\\\"Apple Color Emoji\\\",\\\"Segoe UI Emoji\\\"\",\"height\":\"100vh\",\"textAlign\":\"center\",\"display\":\"flex\",\"flexDirection\":\"column\",\"alignItems\":\"center\",\"justifyContent\":\"center\"},\"children\":[\"$\",\"div\",null,{\"style\":{\"lineHeight\":\"48px\"},\"children\":[[\"$\",\"style\",null,{\"dangerouslySetInnerHTML\":{\"__html\":\"body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}\\n@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}\"}}],[\"$\",\"h1\",null,{\"className\":\"next-error-h1\",\"style\":{\"display\":\"inline-block\",\"margin\":\"0 20px 0 0\",\"paddingRight\":23,\"fontSize\":24,\"fontWeight\":500,\"verticalAlign\":\"top\"},\"children\":\"500\"}],[\"$\",\"div\",null,{\"style\":{\"display\":\"inline-block\"},\"children\":[\"$\",\"h2\",null,{\"style\":{\"fontSize\":14,\"fontWeight\":400,\"lineHeight\":\"28px\"},\"children\":\"Internal Server Error.\"}]}]]}]}]}]]}],null,[\"$\",\"$L4\",null,{\"children\":[\"$\",\"$5\",null,{\"name\":\"Next.MetadataOutlet\",\"children\":\"$@6\"}]}]]}],{},null,false,false]},null,false,false]},null,false,false],[\"$\",\"$1\",\"h\",{\"children\":[null,[\"$\",\"$L7\",null,{\"children\":\"$L8\"}],[\"$\",\"div\",null,{\"hidden\":true,\"children\":[\"$\",\"$L9\",null,{\"children\":[\"$\",\"$5\",null,{\"name\":\"Next.Metadata\",\"children\":\"$La\"}]}]}],[\"$\",\"meta\",null,{\"name\":\"next-size-adjust\",\"content\":\"\"}]]}],false]],\"m\":\"$undefined\",\"G\":[\"$b\",[]],\"S\":true}\n"])</script><script>self.__next_f.push([1,"8:[[\"$\",\"meta\",\"0\",{\"charSet\":\"utf-8\"}],[\"$\",\"meta\",\"1\",{\"name\":\"viewport\",\"content\":\"width=device-width, initial-scale=1\"}]]\n"])</script><script>self.__next_f.push([1,"6:null\na:[]\n"])</script></body></html>
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"node":{},"edge":{},"encryptionKey":"
|
|
1
|
+
{"node":{},"edge":{},"encryptionKey":"Asq/CXM6FrTo+2nRb88mBa7hUTCf9iI4EiCIySW3oqY="}
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
/* eslint-disable node/no-deprecated-api */
|
|
2
|
+
|
|
3
|
+
var toString = Object.prototype.toString
|
|
4
|
+
|
|
5
|
+
var isModern = (
|
|
6
|
+
typeof Buffer !== 'undefined' &&
|
|
7
|
+
typeof Buffer.alloc === 'function' &&
|
|
8
|
+
typeof Buffer.allocUnsafe === 'function' &&
|
|
9
|
+
typeof Buffer.from === 'function'
|
|
10
|
+
)
|
|
11
|
+
|
|
12
|
+
function isArrayBuffer (input) {
|
|
13
|
+
return toString.call(input).slice(8, -1) === 'ArrayBuffer'
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
function fromArrayBuffer (obj, byteOffset, length) {
|
|
17
|
+
byteOffset >>>= 0
|
|
18
|
+
|
|
19
|
+
var maxLength = obj.byteLength - byteOffset
|
|
20
|
+
|
|
21
|
+
if (maxLength < 0) {
|
|
22
|
+
throw new RangeError("'offset' is out of bounds")
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
if (length === undefined) {
|
|
26
|
+
length = maxLength
|
|
27
|
+
} else {
|
|
28
|
+
length >>>= 0
|
|
29
|
+
|
|
30
|
+
if (length > maxLength) {
|
|
31
|
+
throw new RangeError("'length' is out of bounds")
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
return isModern
|
|
36
|
+
? Buffer.from(obj.slice(byteOffset, byteOffset + length))
|
|
37
|
+
: new Buffer(new Uint8Array(obj.slice(byteOffset, byteOffset + length)))
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
function fromString (string, encoding) {
|
|
41
|
+
if (typeof encoding !== 'string' || encoding === '') {
|
|
42
|
+
encoding = 'utf8'
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
if (!Buffer.isEncoding(encoding)) {
|
|
46
|
+
throw new TypeError('"encoding" must be a valid string encoding')
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
return isModern
|
|
50
|
+
? Buffer.from(string, encoding)
|
|
51
|
+
: new Buffer(string, encoding)
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
function bufferFrom (value, encodingOrOffset, length) {
|
|
55
|
+
if (typeof value === 'number') {
|
|
56
|
+
throw new TypeError('"value" argument must not be a number')
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
if (isArrayBuffer(value)) {
|
|
60
|
+
return fromArrayBuffer(value, encodingOrOffset, length)
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
if (typeof value === 'string') {
|
|
64
|
+
return fromString(value, encodingOrOffset)
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
return isModern
|
|
68
|
+
? Buffer.from(value)
|
|
69
|
+
: new Buffer(value)
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
module.exports = bufferFrom
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "buffer-from",
|
|
3
|
+
"version": "1.1.2",
|
|
4
|
+
"license": "MIT",
|
|
5
|
+
"repository": "LinusU/buffer-from",
|
|
6
|
+
"files": [
|
|
7
|
+
"index.js"
|
|
8
|
+
],
|
|
9
|
+
"scripts": {
|
|
10
|
+
"test": "standard && node test"
|
|
11
|
+
},
|
|
12
|
+
"devDependencies": {
|
|
13
|
+
"standard": "^12.0.1"
|
|
14
|
+
},
|
|
15
|
+
"keywords": [
|
|
16
|
+
"buffer",
|
|
17
|
+
"buffer from"
|
|
18
|
+
]
|
|
19
|
+
}
|
|
@@ -0,0 +1,121 @@
|
|
|
1
|
+
/* -*- Mode: js; js-indent-level: 2; -*- */
|
|
2
|
+
/*
|
|
3
|
+
* Copyright 2011 Mozilla Foundation and contributors
|
|
4
|
+
* Licensed under the New BSD license. See LICENSE or:
|
|
5
|
+
* http://opensource.org/licenses/BSD-3-Clause
|
|
6
|
+
*/
|
|
7
|
+
|
|
8
|
+
var util = require('./util');
|
|
9
|
+
var has = Object.prototype.hasOwnProperty;
|
|
10
|
+
var hasNativeMap = typeof Map !== "undefined";
|
|
11
|
+
|
|
12
|
+
/**
|
|
13
|
+
* A data structure which is a combination of an array and a set. Adding a new
|
|
14
|
+
* member is O(1), testing for membership is O(1), and finding the index of an
|
|
15
|
+
* element is O(1). Removing elements from the set is not supported. Only
|
|
16
|
+
* strings are supported for membership.
|
|
17
|
+
*/
|
|
18
|
+
function ArraySet() {
|
|
19
|
+
this._array = [];
|
|
20
|
+
this._set = hasNativeMap ? new Map() : Object.create(null);
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
/**
|
|
24
|
+
* Static method for creating ArraySet instances from an existing array.
|
|
25
|
+
*/
|
|
26
|
+
ArraySet.fromArray = function ArraySet_fromArray(aArray, aAllowDuplicates) {
|
|
27
|
+
var set = new ArraySet();
|
|
28
|
+
for (var i = 0, len = aArray.length; i < len; i++) {
|
|
29
|
+
set.add(aArray[i], aAllowDuplicates);
|
|
30
|
+
}
|
|
31
|
+
return set;
|
|
32
|
+
};
|
|
33
|
+
|
|
34
|
+
/**
|
|
35
|
+
* Return how many unique items are in this ArraySet. If duplicates have been
|
|
36
|
+
* added, than those do not count towards the size.
|
|
37
|
+
*
|
|
38
|
+
* @returns Number
|
|
39
|
+
*/
|
|
40
|
+
ArraySet.prototype.size = function ArraySet_size() {
|
|
41
|
+
return hasNativeMap ? this._set.size : Object.getOwnPropertyNames(this._set).length;
|
|
42
|
+
};
|
|
43
|
+
|
|
44
|
+
/**
|
|
45
|
+
* Add the given string to this set.
|
|
46
|
+
*
|
|
47
|
+
* @param String aStr
|
|
48
|
+
*/
|
|
49
|
+
ArraySet.prototype.add = function ArraySet_add(aStr, aAllowDuplicates) {
|
|
50
|
+
var sStr = hasNativeMap ? aStr : util.toSetString(aStr);
|
|
51
|
+
var isDuplicate = hasNativeMap ? this.has(aStr) : has.call(this._set, sStr);
|
|
52
|
+
var idx = this._array.length;
|
|
53
|
+
if (!isDuplicate || aAllowDuplicates) {
|
|
54
|
+
this._array.push(aStr);
|
|
55
|
+
}
|
|
56
|
+
if (!isDuplicate) {
|
|
57
|
+
if (hasNativeMap) {
|
|
58
|
+
this._set.set(aStr, idx);
|
|
59
|
+
} else {
|
|
60
|
+
this._set[sStr] = idx;
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
};
|
|
64
|
+
|
|
65
|
+
/**
|
|
66
|
+
* Is the given string a member of this set?
|
|
67
|
+
*
|
|
68
|
+
* @param String aStr
|
|
69
|
+
*/
|
|
70
|
+
ArraySet.prototype.has = function ArraySet_has(aStr) {
|
|
71
|
+
if (hasNativeMap) {
|
|
72
|
+
return this._set.has(aStr);
|
|
73
|
+
} else {
|
|
74
|
+
var sStr = util.toSetString(aStr);
|
|
75
|
+
return has.call(this._set, sStr);
|
|
76
|
+
}
|
|
77
|
+
};
|
|
78
|
+
|
|
79
|
+
/**
|
|
80
|
+
* What is the index of the given string in the array?
|
|
81
|
+
*
|
|
82
|
+
* @param String aStr
|
|
83
|
+
*/
|
|
84
|
+
ArraySet.prototype.indexOf = function ArraySet_indexOf(aStr) {
|
|
85
|
+
if (hasNativeMap) {
|
|
86
|
+
var idx = this._set.get(aStr);
|
|
87
|
+
if (idx >= 0) {
|
|
88
|
+
return idx;
|
|
89
|
+
}
|
|
90
|
+
} else {
|
|
91
|
+
var sStr = util.toSetString(aStr);
|
|
92
|
+
if (has.call(this._set, sStr)) {
|
|
93
|
+
return this._set[sStr];
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
throw new Error('"' + aStr + '" is not in the set.');
|
|
98
|
+
};
|
|
99
|
+
|
|
100
|
+
/**
|
|
101
|
+
* What is the element at the given index?
|
|
102
|
+
*
|
|
103
|
+
* @param Number aIdx
|
|
104
|
+
*/
|
|
105
|
+
ArraySet.prototype.at = function ArraySet_at(aIdx) {
|
|
106
|
+
if (aIdx >= 0 && aIdx < this._array.length) {
|
|
107
|
+
return this._array[aIdx];
|
|
108
|
+
}
|
|
109
|
+
throw new Error('No element indexed by ' + aIdx);
|
|
110
|
+
};
|
|
111
|
+
|
|
112
|
+
/**
|
|
113
|
+
* Returns the array representation of this set (which has the proper indices
|
|
114
|
+
* indicated by indexOf). Note that this is a copy of the internal array used
|
|
115
|
+
* for storing the members so that no one can mess with internal state.
|
|
116
|
+
*/
|
|
117
|
+
ArraySet.prototype.toArray = function ArraySet_toArray() {
|
|
118
|
+
return this._array.slice();
|
|
119
|
+
};
|
|
120
|
+
|
|
121
|
+
exports.ArraySet = ArraySet;
|
|
@@ -0,0 +1,140 @@
|
|
|
1
|
+
/* -*- Mode: js; js-indent-level: 2; -*- */
|
|
2
|
+
/*
|
|
3
|
+
* Copyright 2011 Mozilla Foundation and contributors
|
|
4
|
+
* Licensed under the New BSD license. See LICENSE or:
|
|
5
|
+
* http://opensource.org/licenses/BSD-3-Clause
|
|
6
|
+
*
|
|
7
|
+
* Based on the Base 64 VLQ implementation in Closure Compiler:
|
|
8
|
+
* https://code.google.com/p/closure-compiler/source/browse/trunk/src/com/google/debugging/sourcemap/Base64VLQ.java
|
|
9
|
+
*
|
|
10
|
+
* Copyright 2011 The Closure Compiler Authors. All rights reserved.
|
|
11
|
+
* Redistribution and use in source and binary forms, with or without
|
|
12
|
+
* modification, are permitted provided that the following conditions are
|
|
13
|
+
* met:
|
|
14
|
+
*
|
|
15
|
+
* * Redistributions of source code must retain the above copyright
|
|
16
|
+
* notice, this list of conditions and the following disclaimer.
|
|
17
|
+
* * Redistributions in binary form must reproduce the above
|
|
18
|
+
* copyright notice, this list of conditions and the following
|
|
19
|
+
* disclaimer in the documentation and/or other materials provided
|
|
20
|
+
* with the distribution.
|
|
21
|
+
* * Neither the name of Google Inc. nor the names of its
|
|
22
|
+
* contributors may be used to endorse or promote products derived
|
|
23
|
+
* from this software without specific prior written permission.
|
|
24
|
+
*
|
|
25
|
+
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
|
26
|
+
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
|
27
|
+
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
|
28
|
+
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
|
29
|
+
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
|
30
|
+
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
|
31
|
+
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
|
32
|
+
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
|
33
|
+
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
|
34
|
+
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
|
35
|
+
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
36
|
+
*/
|
|
37
|
+
|
|
38
|
+
var base64 = require('./base64');
|
|
39
|
+
|
|
40
|
+
// A single base 64 digit can contain 6 bits of data. For the base 64 variable
|
|
41
|
+
// length quantities we use in the source map spec, the first bit is the sign,
|
|
42
|
+
// the next four bits are the actual value, and the 6th bit is the
|
|
43
|
+
// continuation bit. The continuation bit tells us whether there are more
|
|
44
|
+
// digits in this value following this digit.
|
|
45
|
+
//
|
|
46
|
+
// Continuation
|
|
47
|
+
// | Sign
|
|
48
|
+
// | |
|
|
49
|
+
// V V
|
|
50
|
+
// 101011
|
|
51
|
+
|
|
52
|
+
var VLQ_BASE_SHIFT = 5;
|
|
53
|
+
|
|
54
|
+
// binary: 100000
|
|
55
|
+
var VLQ_BASE = 1 << VLQ_BASE_SHIFT;
|
|
56
|
+
|
|
57
|
+
// binary: 011111
|
|
58
|
+
var VLQ_BASE_MASK = VLQ_BASE - 1;
|
|
59
|
+
|
|
60
|
+
// binary: 100000
|
|
61
|
+
var VLQ_CONTINUATION_BIT = VLQ_BASE;
|
|
62
|
+
|
|
63
|
+
/**
|
|
64
|
+
* Converts from a two-complement value to a value where the sign bit is
|
|
65
|
+
* placed in the least significant bit. For example, as decimals:
|
|
66
|
+
* 1 becomes 2 (10 binary), -1 becomes 3 (11 binary)
|
|
67
|
+
* 2 becomes 4 (100 binary), -2 becomes 5 (101 binary)
|
|
68
|
+
*/
|
|
69
|
+
function toVLQSigned(aValue) {
|
|
70
|
+
return aValue < 0
|
|
71
|
+
? ((-aValue) << 1) + 1
|
|
72
|
+
: (aValue << 1) + 0;
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
/**
|
|
76
|
+
* Converts to a two-complement value from a value where the sign bit is
|
|
77
|
+
* placed in the least significant bit. For example, as decimals:
|
|
78
|
+
* 2 (10 binary) becomes 1, 3 (11 binary) becomes -1
|
|
79
|
+
* 4 (100 binary) becomes 2, 5 (101 binary) becomes -2
|
|
80
|
+
*/
|
|
81
|
+
function fromVLQSigned(aValue) {
|
|
82
|
+
var isNegative = (aValue & 1) === 1;
|
|
83
|
+
var shifted = aValue >> 1;
|
|
84
|
+
return isNegative
|
|
85
|
+
? -shifted
|
|
86
|
+
: shifted;
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
/**
|
|
90
|
+
* Returns the base 64 VLQ encoded value.
|
|
91
|
+
*/
|
|
92
|
+
exports.encode = function base64VLQ_encode(aValue) {
|
|
93
|
+
var encoded = "";
|
|
94
|
+
var digit;
|
|
95
|
+
|
|
96
|
+
var vlq = toVLQSigned(aValue);
|
|
97
|
+
|
|
98
|
+
do {
|
|
99
|
+
digit = vlq & VLQ_BASE_MASK;
|
|
100
|
+
vlq >>>= VLQ_BASE_SHIFT;
|
|
101
|
+
if (vlq > 0) {
|
|
102
|
+
// There are still more digits in this value, so we must make sure the
|
|
103
|
+
// continuation bit is marked.
|
|
104
|
+
digit |= VLQ_CONTINUATION_BIT;
|
|
105
|
+
}
|
|
106
|
+
encoded += base64.encode(digit);
|
|
107
|
+
} while (vlq > 0);
|
|
108
|
+
|
|
109
|
+
return encoded;
|
|
110
|
+
};
|
|
111
|
+
|
|
112
|
+
/**
|
|
113
|
+
* Decodes the next base 64 VLQ value from the given string and returns the
|
|
114
|
+
* value and the rest of the string via the out parameter.
|
|
115
|
+
*/
|
|
116
|
+
exports.decode = function base64VLQ_decode(aStr, aIndex, aOutParam) {
|
|
117
|
+
var strLen = aStr.length;
|
|
118
|
+
var result = 0;
|
|
119
|
+
var shift = 0;
|
|
120
|
+
var continuation, digit;
|
|
121
|
+
|
|
122
|
+
do {
|
|
123
|
+
if (aIndex >= strLen) {
|
|
124
|
+
throw new Error("Expected more digits in base 64 VLQ value.");
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
digit = base64.decode(aStr.charCodeAt(aIndex++));
|
|
128
|
+
if (digit === -1) {
|
|
129
|
+
throw new Error("Invalid base64 digit: " + aStr.charAt(aIndex - 1));
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
continuation = !!(digit & VLQ_CONTINUATION_BIT);
|
|
133
|
+
digit &= VLQ_BASE_MASK;
|
|
134
|
+
result = result + (digit << shift);
|
|
135
|
+
shift += VLQ_BASE_SHIFT;
|
|
136
|
+
} while (continuation);
|
|
137
|
+
|
|
138
|
+
aOutParam.value = fromVLQSigned(result);
|
|
139
|
+
aOutParam.rest = aIndex;
|
|
140
|
+
};
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
/* -*- Mode: js; js-indent-level: 2; -*- */
|
|
2
|
+
/*
|
|
3
|
+
* Copyright 2011 Mozilla Foundation and contributors
|
|
4
|
+
* Licensed under the New BSD license. See LICENSE or:
|
|
5
|
+
* http://opensource.org/licenses/BSD-3-Clause
|
|
6
|
+
*/
|
|
7
|
+
|
|
8
|
+
var intToCharMap = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/'.split('');
|
|
9
|
+
|
|
10
|
+
/**
|
|
11
|
+
* Encode an integer in the range of 0 to 63 to a single base 64 digit.
|
|
12
|
+
*/
|
|
13
|
+
exports.encode = function (number) {
|
|
14
|
+
if (0 <= number && number < intToCharMap.length) {
|
|
15
|
+
return intToCharMap[number];
|
|
16
|
+
}
|
|
17
|
+
throw new TypeError("Must be between 0 and 63: " + number);
|
|
18
|
+
};
|
|
19
|
+
|
|
20
|
+
/**
|
|
21
|
+
* Decode a single base 64 character code digit to an integer. Returns -1 on
|
|
22
|
+
* failure.
|
|
23
|
+
*/
|
|
24
|
+
exports.decode = function (charCode) {
|
|
25
|
+
var bigA = 65; // 'A'
|
|
26
|
+
var bigZ = 90; // 'Z'
|
|
27
|
+
|
|
28
|
+
var littleA = 97; // 'a'
|
|
29
|
+
var littleZ = 122; // 'z'
|
|
30
|
+
|
|
31
|
+
var zero = 48; // '0'
|
|
32
|
+
var nine = 57; // '9'
|
|
33
|
+
|
|
34
|
+
var plus = 43; // '+'
|
|
35
|
+
var slash = 47; // '/'
|
|
36
|
+
|
|
37
|
+
var littleOffset = 26;
|
|
38
|
+
var numberOffset = 52;
|
|
39
|
+
|
|
40
|
+
// 0 - 25: ABCDEFGHIJKLMNOPQRSTUVWXYZ
|
|
41
|
+
if (bigA <= charCode && charCode <= bigZ) {
|
|
42
|
+
return (charCode - bigA);
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
// 26 - 51: abcdefghijklmnopqrstuvwxyz
|
|
46
|
+
if (littleA <= charCode && charCode <= littleZ) {
|
|
47
|
+
return (charCode - littleA + littleOffset);
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
// 52 - 61: 0123456789
|
|
51
|
+
if (zero <= charCode && charCode <= nine) {
|
|
52
|
+
return (charCode - zero + numberOffset);
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
// 62: +
|
|
56
|
+
if (charCode == plus) {
|
|
57
|
+
return 62;
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
// 63: /
|
|
61
|
+
if (charCode == slash) {
|
|
62
|
+
return 63;
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
// Invalid base64 digit.
|
|
66
|
+
return -1;
|
|
67
|
+
};
|