@cline/core 0.0.95 → 0.2.0
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/dist/ClineCore.d.ts +6 -1
- package/dist/account/rpc.d.ts +3 -1
- package/dist/cline-core/runtime-services.d.ts +4 -2
- package/dist/cloud/controller.d.ts +5 -2
- package/dist/cloud/hub-client.d.ts +51 -0
- package/dist/cloud/hub-protocol.d.ts +18 -0
- package/dist/cloud/index.d.ts +2 -0
- package/dist/cloud/index.js +16 -16
- package/dist/cloud/types.d.ts +4 -1
- package/dist/extensions/context/compaction-shared.d.ts +1 -0
- package/dist/extensions/context/compaction.d.ts +7 -0
- package/dist/extensions/context/summarize-conversation.d.ts +7 -0
- package/dist/extensions/context/summary-generation.d.ts +14 -0
- package/dist/extensions/mcp/apps.d.ts +16 -0
- package/dist/extensions/mcp/client.d.ts +1 -0
- package/dist/extensions/mcp/index.d.ts +5 -1
- package/dist/extensions/mcp/manager.d.ts +2 -1
- package/dist/extensions/mcp/session-apps.d.ts +28 -0
- package/dist/extensions/mcp/types.d.ts +22 -0
- package/dist/extensions/plugin/plugin-command-origin.d.ts +8 -0
- package/dist/extensions/plugin/plugin-registry.d.ts +1 -0
- package/dist/extensions/plugin/plugin-runtime.d.ts +7 -0
- package/dist/hub/client/index.d.ts +6 -0
- package/dist/hub/client/managed-hub-build-watcher.d.ts +2 -0
- package/dist/hub/client/plugin-commands.d.ts +4 -0
- package/dist/hub/client/session-client.d.ts +2 -0
- package/dist/hub/daemon/entry.js +241 -228
- package/dist/hub/index.d.ts +1 -0
- package/dist/hub/index.js +231 -218
- package/dist/hub/runtime-host/hub-runtime-host.d.ts +6 -0
- package/dist/hub/server/cloud-session-service.d.ts +50 -0
- package/dist/hub/server/handlers/capability-handlers.d.ts +18 -1
- package/dist/hub/server/handlers/context.d.ts +13 -2
- package/dist/hub/server/handlers/mcp-apps-handlers.d.ts +5 -0
- package/dist/hub/server/hub-server-options.d.ts +3 -0
- package/dist/hub/server/hub-server-transport.d.ts +2 -0
- package/dist/index.d.ts +8 -4
- package/dist/index.js +278 -258
- package/dist/plugin-runtime/node_modules/@cline/agents/dist/index.js +76 -0
- package/dist/plugin-runtime/node_modules/@cline/agents/package.json +1 -0
- package/dist/plugin-runtime/node_modules/@cline/core/dist/ai-sdk-b1d8eb67.js +1 -0
- package/dist/plugin-runtime/node_modules/@cline/core/dist/anthropic-33qvrctr.js +1 -0
- package/dist/plugin-runtime/node_modules/@cline/core/dist/bedrock-paabhz8w.js +1 -0
- package/dist/plugin-runtime/node_modules/@cline/core/dist/cline-yhsfqcy1.js +1 -0
- package/dist/plugin-runtime/node_modules/@cline/core/dist/cloud/index.js +21 -0
- package/dist/plugin-runtime/node_modules/@cline/core/dist/community-gqgs7446.js +1 -0
- package/dist/plugin-runtime/node_modules/@cline/core/dist/foundation-models-embedding-model-strategy-SAVQFBF4-822304b0.js +1 -0
- package/dist/plugin-runtime/node_modules/@cline/core/dist/foundation-models-language-model-strategy-BPQO66W7-hky2m2yx.js +1 -0
- package/dist/plugin-runtime/node_modules/@cline/core/dist/getMachineId-bsd-sqf1kd37.js +1 -0
- package/dist/plugin-runtime/node_modules/@cline/core/dist/getMachineId-bsd-tx1kp6xn.js +1 -0
- package/dist/plugin-runtime/node_modules/@cline/core/dist/getMachineId-darwin-6cpgjxme.js +2 -0
- package/dist/plugin-runtime/node_modules/@cline/core/dist/getMachineId-darwin-fxchqbze.js +2 -0
- package/dist/plugin-runtime/node_modules/@cline/core/dist/getMachineId-linux-m3bzwmzc.js +1 -0
- package/dist/plugin-runtime/node_modules/@cline/core/dist/getMachineId-linux-pr9sb5fr.js +1 -0
- package/dist/plugin-runtime/node_modules/@cline/core/dist/getMachineId-unsupported-nckraycx.js +1 -0
- package/dist/plugin-runtime/node_modules/@cline/core/dist/getMachineId-unsupported-w91yq3tm.js +1 -0
- package/dist/plugin-runtime/node_modules/@cline/core/dist/getMachineId-win-xdyxc2tf.js +1 -0
- package/dist/plugin-runtime/node_modules/@cline/core/dist/getMachineId-win-yxsvs11a.js +1 -0
- package/dist/plugin-runtime/node_modules/@cline/core/dist/google-pgdk2dm9.js +1 -0
- package/dist/plugin-runtime/node_modules/@cline/core/dist/hub/daemon/entry.js +1160 -0
- package/dist/plugin-runtime/node_modules/@cline/core/dist/hub/index.js +1147 -0
- package/dist/plugin-runtime/node_modules/@cline/core/dist/index-02jpyn9y.js +85 -0
- package/dist/plugin-runtime/node_modules/@cline/core/dist/index-0cb4390m.js +137 -0
- package/dist/plugin-runtime/node_modules/@cline/core/dist/index-0f8xrhgt.js +209 -0
- package/dist/plugin-runtime/node_modules/@cline/core/dist/index-1f8vb421.js +2 -0
- package/dist/plugin-runtime/node_modules/@cline/core/dist/index-28c7m0fv.js +16 -0
- package/dist/plugin-runtime/node_modules/@cline/core/dist/index-2em3jg4q.js +1 -0
- package/dist/plugin-runtime/node_modules/@cline/core/dist/index-4n1zpzbe.js +2 -0
- package/dist/plugin-runtime/node_modules/@cline/core/dist/index-54eea0ex.js +2 -0
- package/dist/plugin-runtime/node_modules/@cline/core/dist/index-5j92dtg5.js +16 -0
- package/dist/plugin-runtime/node_modules/@cline/core/dist/index-6akf3a5d.js +2 -0
- package/dist/plugin-runtime/node_modules/@cline/core/dist/index-6k6ep10s.js +136 -0
- package/dist/plugin-runtime/node_modules/@cline/core/dist/index-71ym4q6s.js +2 -0
- package/dist/plugin-runtime/node_modules/@cline/core/dist/index-91p1ghfk.js +14 -0
- package/dist/plugin-runtime/node_modules/@cline/core/dist/index-9qkpjy7x.js +2 -0
- package/dist/plugin-runtime/node_modules/@cline/core/dist/index-9swk4nej.js +3 -0
- package/dist/plugin-runtime/node_modules/@cline/core/dist/index-aa2s5myc.js +1 -0
- package/dist/plugin-runtime/node_modules/@cline/core/dist/index-ae0ajw38.js +13 -0
- package/dist/plugin-runtime/node_modules/@cline/core/dist/index-bxvyzjhc.js +1 -0
- package/dist/plugin-runtime/node_modules/@cline/core/dist/index-bzy863k0.js +6 -0
- package/dist/plugin-runtime/node_modules/@cline/core/dist/index-d96n0s70.js +20 -0
- package/dist/plugin-runtime/node_modules/@cline/core/dist/index-dsd6vt8c.js +1 -0
- package/dist/plugin-runtime/node_modules/@cline/core/dist/index-e2q4azd9.js +119 -0
- package/dist/plugin-runtime/node_modules/@cline/core/dist/index-egd18jj2.js +4 -0
- package/dist/plugin-runtime/node_modules/@cline/core/dist/index-eh83hr16.js +2 -0
- package/dist/plugin-runtime/node_modules/@cline/core/dist/index-ev9r2dy3.js +1204 -0
- package/dist/plugin-runtime/node_modules/@cline/core/dist/index-f2mvvryf.js +190 -0
- package/dist/plugin-runtime/node_modules/@cline/core/dist/index-h7gn5v3f.js +2 -0
- package/dist/plugin-runtime/node_modules/@cline/core/dist/index-h7s1a560.js +12 -0
- package/dist/plugin-runtime/node_modules/@cline/core/dist/index-hkhq3jtz.js +21 -0
- package/dist/plugin-runtime/node_modules/@cline/core/dist/index-j8r18nfg.js +15 -0
- package/dist/plugin-runtime/node_modules/@cline/core/dist/index-jhny555h.js +6 -0
- package/dist/plugin-runtime/node_modules/@cline/core/dist/index-m1gpa2eg.js +146 -0
- package/dist/plugin-runtime/node_modules/@cline/core/dist/index-m2ad6tgj.js +1 -0
- package/dist/plugin-runtime/node_modules/@cline/core/dist/index-m7mks2jq.js +4 -0
- package/dist/plugin-runtime/node_modules/@cline/core/dist/index-mcnngj50.js +62 -0
- package/dist/plugin-runtime/node_modules/@cline/core/dist/index-n2srkkh0.js +39 -0
- package/dist/plugin-runtime/node_modules/@cline/core/dist/index-nbs1tsny.js +142 -0
- package/dist/plugin-runtime/node_modules/@cline/core/dist/index-nqjnz7m4.js +9 -0
- package/dist/plugin-runtime/node_modules/@cline/core/dist/index-rmhzyxr8.js +3 -0
- package/dist/plugin-runtime/node_modules/@cline/core/dist/index-rtzf3vvk.js +6 -0
- package/dist/plugin-runtime/node_modules/@cline/core/dist/index-sw74pcm3.js +2 -0
- package/dist/plugin-runtime/node_modules/@cline/core/dist/index-t3eanyjj.js +3 -0
- package/dist/plugin-runtime/node_modules/@cline/core/dist/index-tseksj1v.js +1 -0
- package/dist/plugin-runtime/node_modules/@cline/core/dist/index-v0ctpcdr.js +12 -0
- package/dist/plugin-runtime/node_modules/@cline/core/dist/index-v4-dx8bd4wq.js +1 -0
- package/dist/plugin-runtime/node_modules/@cline/core/dist/index-v695918t.js +14 -0
- package/dist/plugin-runtime/node_modules/@cline/core/dist/index-v96yy1pw.js +1 -0
- package/dist/plugin-runtime/node_modules/@cline/core/dist/index-vfm7r9wk.js +65 -0
- package/dist/plugin-runtime/node_modules/@cline/core/dist/index-xecthgrg.js +9 -0
- package/dist/plugin-runtime/node_modules/@cline/core/dist/index-xn1xhp06.js +9 -0
- package/dist/plugin-runtime/node_modules/@cline/core/dist/index-yfdscfdx.js +1 -0
- package/dist/plugin-runtime/node_modules/@cline/core/dist/index-yrnwqsdt.js +2 -0
- package/dist/plugin-runtime/node_modules/@cline/core/dist/index.js +1 -0
- package/dist/plugin-runtime/node_modules/@cline/core/dist/jiti-static-3mgy2y9y.js +473 -0
- package/dist/plugin-runtime/node_modules/@cline/core/dist/jiti-w1xrs0vd.js +1 -0
- package/dist/plugin-runtime/node_modules/@cline/core/dist/langfuse-stream-telemetry-9tppg77c.js +1 -0
- package/dist/plugin-runtime/node_modules/@cline/core/dist/langfuse-telemetry-y658kpzy.js +1 -0
- package/dist/plugin-runtime/node_modules/@cline/core/dist/mistral-cmhqd91b.js +1 -0
- package/dist/plugin-runtime/node_modules/@cline/core/dist/multipart-parser-qkjjf8mm.js +2 -0
- package/dist/plugin-runtime/node_modules/@cline/core/dist/ollama-8z6y9d1h.js +1 -0
- package/dist/plugin-runtime/node_modules/@cline/core/dist/openai-cfmja1ez.js +1 -0
- package/dist/plugin-runtime/node_modules/@cline/core/dist/openai-compatible-1t7n5sxj.js +1 -0
- package/dist/plugin-runtime/node_modules/@cline/core/dist/orchestration-embedding-model-strategy-GT27AFII-k6yqgnyd.js +1 -0
- package/dist/plugin-runtime/node_modules/@cline/core/dist/orchestration-language-model-strategy-YEQPUCOT-6rdyebbq.js +1 -0
- package/dist/plugin-runtime/node_modules/@cline/core/dist/services/feature-flags/posthog.js +2 -0
- package/dist/plugin-runtime/node_modules/@cline/core/dist/services/telemetry/index.js +1 -0
- package/dist/plugin-runtime/node_modules/@cline/core/dist/token-1h068py9.js +1 -0
- package/dist/plugin-runtime/node_modules/@cline/core/dist/token-util-7jchft51.js +1 -0
- package/dist/plugin-runtime/node_modules/@cline/core/dist/vertex-qfxfsrn4.js +1 -0
- package/dist/plugin-runtime/node_modules/@cline/core/package.json +1 -0
- package/dist/plugin-runtime/node_modules/@cline/llms/dist/index.browser.js +16 -0
- package/dist/plugin-runtime/node_modules/@cline/llms/dist/index.js +1 -0
- package/dist/plugin-runtime/node_modules/@cline/llms/package.json +1 -0
- package/dist/plugin-runtime/node_modules/@cline/sdk/dist/index.js +1 -0
- package/dist/plugin-runtime/node_modules/@cline/sdk/package.json +1 -0
- package/dist/plugin-runtime/node_modules/@cline/shared/dist/automation/index.js +57 -0
- package/dist/plugin-runtime/node_modules/@cline/shared/dist/db/index.js +127 -0
- package/dist/plugin-runtime/node_modules/@cline/shared/dist/index.browser.js +110 -0
- package/dist/plugin-runtime/node_modules/@cline/shared/dist/index.js +1 -0
- package/dist/plugin-runtime/node_modules/@cline/shared/dist/node.js +1 -0
- package/dist/plugin-runtime/node_modules/@cline/shared/dist/remote-config/index.js +68 -0
- package/dist/plugin-runtime/node_modules/@cline/shared/dist/storage/index.js +1 -0
- package/dist/plugin-runtime/node_modules/@cline/shared/dist/types/index.js +1 -0
- package/dist/plugin-runtime/node_modules/@cline/shared/package.json +1 -0
- package/dist/plugin-runtime/package.json +1 -0
- package/dist/{extensions → plugin-runtime}/plugin-sandbox-bootstrap.js +129 -129
- package/dist/remote/remote-environments.d.ts +1 -0
- package/dist/runtime/config/agent-runtime-config-builder.d.ts +2 -0
- package/dist/runtime/host/local-runtime-host.d.ts +10 -0
- package/dist/runtime/host/runtime-host.d.ts +6 -0
- package/dist/runtime/orchestration/runtime-oauth-token-manager.d.ts +3 -0
- package/dist/runtime/orchestration/session-runtime-orchestrator.d.ts +10 -1
- package/dist/runtime/orchestration/session-runtime.d.ts +2 -0
- package/dist/runtime/tools/subprocess-sandbox.d.ts +22 -0
- package/dist/services/llms/cline-recommended-models.d.ts +2 -0
- package/dist/services/local-runtime-bootstrap.d.ts +1 -0
- package/dist/services/plugin-command-api.d.ts +47 -0
- package/dist/services/plugin-commands.d.ts +25 -27
- package/dist/services/skills-cli.d.ts +2 -0
- package/dist/services/telemetry/core-events.d.ts +26 -0
- package/dist/services/telemetry/index.js +1 -1
- package/dist/services/telemetry/run-health.d.ts +40 -0
- package/dist/services/telemetry/stall-signals.d.ts +12 -0
- package/dist/types/config.d.ts +1 -0
- package/dist/types/session.d.ts +7 -0
- package/package.json +6 -5
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{RS}from"./index-6k6ep10s.js";export{RS as propagateAttributes};
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import{i,c}from"./index-mcnngj50.js";var hc=i(function(V,W){/*! safe-buffer. MIT License. Feross Aboukhadijeh <https://feross.org/opensource> */var B=c("buffer"),S=B.Buffer;function U(e,r){for(var t in e)r[t]=e[t]}if(S.from&&S.alloc&&S.allocUnsafe&&S.allocUnsafeSlow)W.exports=B;else U(B,V),V.Buffer=m;function m(e,r,t){return S(e,r,t)}m.prototype=Object.create(S.prototype);U(S,m);m.from=function(e,r,t){if(typeof e==="number")throw TypeError("Argument must not be a number");return S(e,r,t)};m.alloc=function(e,r,t){if(typeof e!=="number")throw TypeError("Argument must be a number");var n=S(e);if(r!==void 0)if(typeof t==="string")n.fill(r,t);else n.fill(r);else n.fill(0);return n};m.allocUnsafe=function(e){if(typeof e!=="number")throw TypeError("Argument must be a number");return S(e)};m.allocUnsafeSlow=function(e){if(typeof e!=="number")throw TypeError("Argument must be a number");return B.SlowBuffer(e)}});var Q=i(function(Br,Z){function K(e){var r=(e/8|0)+(e%8===0?0:1);return r}var Oe={ES256:K(256),ES384:K(384),ES512:K(521)};function De(e){var r=Oe[e];if(r)return r;throw Error('Unknown algorithm "'+e+'"')}Z.exports=De});var xy=i(function(_r,re){var _=hc().Buffer,Y=Q(),T=128,z=0,Ve=32,Ke=16,Ne=2,k=Ke|Ve|z<<6,I=Ne|z<<6;function He(e){return e.replace(/=/g,"").replace(/\+/g,"-").replace(/\//g,"_")}function ee(e){if(_.isBuffer(e))return e;else if(typeof e==="string")return _.from(e,"base64");throw TypeError("ECDSA signature must be a Base64 string or a Buffer")}function Ge(e,r){e=ee(e);var t=Y(r),n=t+1,f=e.length,a=0;if(e[a++]!==k)throw Error('Could not find expected "seq"');var s=e[a++];if(s===(T|1))s=e[a++];if(f-a<s)throw Error('"seq" specified length of "'+s+'", only "'+(f-a)+'" remaining');if(e[a++]!==I)throw Error('Could not find expected "int" for "r"');var l=e[a++];if(f-a-2<l)throw Error('"r" specified length of "'+l+'", only "'+(f-a-2)+'" available');if(n<l)throw Error('"r" specified length of "'+l+'", max of "'+n+'" is acceptable');var d=a;if(a+=l,e[a++]!==I)throw Error('Could not find expected "int" for "s"');var p=e[a++];if(f-a!==p)throw Error('"s" specified length of "'+p+'", expected "'+(f-a)+'"');if(n<p)throw Error('"s" specified length of "'+p+'", max of "'+n+'" is acceptable');var u=a;if(a+=p,a!==f)throw Error('Expected to consume entire buffer, but "'+(f-a)+'" bytes remain');var o=t-l,D=t-p,y=_.allocUnsafe(o+l+D+p);for(a=0;a<o;++a)y[a]=0;e.copy(y,a,d+Math.max(-o,0),d+l),a=t;for(var Re=a;a<Re+D;++a)y[a]=0;return e.copy(y,a,u+Math.max(-D,0),u+p),y=y.toString("base64"),y=He(y),y}function X(e,r,t){var n=0;while(r+n<t&&e[r+n]===0)++n;var f=e[r+n]>=T;if(f)--n;return n}function Je(e,r){e=ee(e);var t=Y(r),n=e.length;if(n!==t*2)throw TypeError('"'+r+'" signatures must be "'+t*2+'" bytes, saw "'+n+'"');var f=X(e,0,t),a=X(e,t,e.length),s=t-f,l=t-a,d=2+s+1+1+l,p=d<T,u=_.allocUnsafe((p?2:3)+d),o=0;if(u[o++]=k,p)u[o++]=d;else u[o++]=T|1,u[o++]=d&255;if(u[o++]=I,u[o++]=s,f<0)u[o++]=0,o+=e.copy(u,o,0,t);else o+=e.copy(u,o,f,t);if(u[o++]=I,u[o++]=l,a<0)u[o++]=0,e.copy(u,o,t);else e.copy(u,o,t+a);return u}re.exports={derToJose:Ge,joseToDer:Je}});var N=i(function(Tr,te){var x=hc().Buffer,Me=c("stream"),je=c("util");function P(e){if(this.buffer=null,this.writable=!0,this.readable=!0,!e)return this.buffer=x.alloc(0),this;if(typeof e.pipe==="function")return this.buffer=x.alloc(0),e.pipe(this),this;if(e.length||typeof e==="object")return this.buffer=e,this.writable=!1,process.nextTick(function(){this.emit("end",e),this.readable=!1,this.emit("close")}.bind(this)),this;throw TypeError("Unexpected data type ("+typeof e+")")}je.inherits(P,Me);P.prototype.write=function(r){this.buffer=x.concat([this.buffer,x.from(r)]),this.emit("data",r)};P.prototype.end=function(r){if(r)this.write(r);this.emit("end",r),this.emit("close"),this.writable=!1,this.readable=!1};te.exports=P});var ie=i(function(Ir,ne){var E=c("buffer").Buffer,H=c("buffer").SlowBuffer;ne.exports=L;function L(e,r){if(!E.isBuffer(e)||!E.isBuffer(r))return!1;if(e.length!==r.length)return!1;var t=0;for(var n=0;n<e.length;n++)t|=e[n]^r[n];return t===0}L.install=function(){E.prototype.equal=H.prototype.equal=function(r){return L(this,r)}};var Ce=E.prototype.equal,Fe=H.prototype.equal;L.restore=function(){E.prototype.equal=Ce,H.prototype.equal=Fe}});var j=i(function(xr,pe){var b=hc().Buffer,h=c("crypto"),fe=xy(),ae=c("util"),Ue=`"%s" is not a valid algorithm.
|
|
2
|
+
Supported algorithms are:
|
|
3
|
+
"HS256", "HS384", "HS512", "RS256", "RS384", "RS512", "PS256", "PS384", "PS512", "ES256", "ES384", "ES512" and "none".`,q="secret must be a string or buffer",g="key must be a string or a buffer",We="key must be a string, a buffer or an object",J=typeof h.createPublicKey==="function";if(J)g+=" or a KeyObject",q+="or a KeyObject";function oe(e){if(b.isBuffer(e))return;if(typeof e==="string")return;if(!J)throw v(g);if(typeof e!=="object")throw v(g);if(typeof e.type!=="string")throw v(g);if(typeof e.asymmetricKeyType!=="string")throw v(g);if(typeof e.export!=="function")throw v(g)}function ue(e){if(b.isBuffer(e))return;if(typeof e==="string")return;if(typeof e==="object")return;throw v(We)}function Ze(e){if(b.isBuffer(e))return;if(typeof e==="string")return e;if(!J)throw v(q);if(typeof e!=="object")throw v(q);if(e.type!=="secret")throw v(q);if(typeof e.export!=="function")throw v(q)}function M(e){return e.replace(/=/g,"").replace(/\+/g,"-").replace(/\//g,"_")}function se(e){e=e.toString();var r=4-e.length%4;if(r!==4)for(var t=0;t<r;++t)e+="=";return e.replace(/\-/g,"+").replace(/_/g,"/")}function v(e){var r=[].slice.call(arguments,1),t=ae.format.bind(ae,e).apply(null,r);return TypeError(t)}function $e(e){return b.isBuffer(e)||typeof e==="string"}function A(e){if(!$e(e))e=JSON.stringify(e);return e}function ce(e){return function(t,n){Ze(n),t=A(t);var f=h.createHmac("sha"+e,n),a=(f.update(t),f.digest("base64"));return M(a)}}var G,Qe="timingSafeEqual"in h?function(r,t){if(r.byteLength!==t.byteLength)return!1;return h.timingSafeEqual(r,t)}:function(r,t){if(!G)G=ie();return G(r,t)};function Xe(e){return function(t,n,f){var a=ce(e)(t,f);return Qe(b.from(n),b.from(a))}}function le(e){return function(t,n){ue(n),t=A(t);var f=h.createSign("RSA-SHA"+e),a=(f.update(t),f.sign(n,"base64"));return M(a)}}function he(e){return function(t,n,f){oe(f),t=A(t),n=se(n);var a=h.createVerify("RSA-SHA"+e);return a.update(t),a.verify(f,n,"base64")}}function Ye(e){return function(t,n){ue(n),t=A(t);var f=h.createSign("RSA-SHA"+e),a=(f.update(t),f.sign({key:n,padding:h.constants.RSA_PKCS1_PSS_PADDING,saltLength:h.constants.RSA_PSS_SALTLEN_DIGEST},"base64"));return M(a)}}function ze(e){return function(t,n,f){oe(f),t=A(t),n=se(n);var a=h.createVerify("RSA-SHA"+e);return a.update(t),a.verify({key:f,padding:h.constants.RSA_PKCS1_PSS_PADDING,saltLength:h.constants.RSA_PSS_SALTLEN_DIGEST},n,"base64")}}function ke(e){var r=le(e);return function(){var n=r.apply(null,arguments);return n=fe.derToJose(n,"ES"+e),n}}function er(e){var r=he(e);return function(n,f,a){f=fe.joseToDer(f,"ES"+e).toString("base64");var s=r(n,f,a);return s}}function rr(){return function(){return""}}function tr(){return function(r,t){return t===""}}pe.exports=function(r){var t={hs:ce,rs:le,ps:Ye,es:ke,none:rr},n={hs:Xe,rs:he,ps:ze,es:er,none:tr},f=r.match(/^(RS|PS|ES|HS)(256|384|512)$|^(none)$/);if(!f)throw v(Ue,r);var a=(f[1]||f[3]).toLowerCase(),s=f[2];return{sign:t[a](s),verify:n[a](s)}}});var C=i(function(Pr,ve){var nr=c("buffer").Buffer;ve.exports=function(r){if(typeof r==="string")return r;if(typeof r==="number"||nr.isBuffer(r))return r.toString();return JSON.stringify(r)}});var be=i(function(Lr,ge){var ir=hc().Buffer,Se=N(),ar=j(),fr=c("stream"),ye=C(),F=c("util");function de(e,r){return ir.from(e,r).toString("base64").replace(/=/g,"").replace(/\+/g,"-").replace(/\//g,"_")}function or(e,r,t){t=t||"utf8";var n=de(ye(e),"binary"),f=de(ye(r),t);return F.format("%s.%s",n,f)}function me(e){var{header:r,payload:t}=e,n=e.secret||e.privateKey,f=e.encoding,a=ar(r.alg),s=or(r,t,f),l=a.sign(s,n);return F.format("%s.%s",s,l)}function R(e){var r=e.secret;if(r=r==null?e.privateKey:r,r=r==null?e.key:r,/^hs/i.test(e.header.alg)===!0&&r==null)throw TypeError("secret must be a string or buffer or a KeyObject");var t=new Se(r);this.readable=!0,this.header=e.header,this.encoding=e.encoding,this.secret=this.privateKey=this.key=t,this.payload=new Se(e.payload),this.secret.once("close",function(){if(!this.payload.writable&&this.readable)this.sign()}.bind(this)),this.payload.once("close",function(){if(!this.secret.writable&&this.readable)this.sign()}.bind(this))}F.inherits(R,fr);R.prototype.sign=function(){try{var r=me({header:this.header,payload:this.payload.buffer,secret:this.secret.buffer,encoding:this.encoding});return this.emit("done",r),this.emit("data",r),this.emit("end"),this.readable=!1,r}catch(t){this.readable=!1,this.emit("error",t),this.emit("close")}};R.sign=me;ge.exports=R});var Pe=i(function(Rr,xe){var Ee=hc().Buffer,we=N(),ur=j(),sr=c("stream"),qe=C(),cr=c("util"),lr=/^[a-zA-Z0-9\-_]+?\.[a-zA-Z0-9\-_]+?\.([a-zA-Z0-9\-_]+)?$/;function hr(e){return Object.prototype.toString.call(e)==="[object Object]"}function pr(e){if(hr(e))return e;try{return JSON.parse(e)}catch(r){return}}function Ae(e){var r=e.split(".",1)[0];return pr(Ee.from(r,"base64").toString("binary"))}function vr(e){return e.split(".",2).join(".")}function Be(e){return e.split(".")[2]}function Sr(e,r){r=r||"utf8";var t=e.split(".")[1];return Ee.from(t,"base64").toString(r)}function _e(e){return lr.test(e)&&!!Ae(e)}function Te(e,r,t){if(!r){var n=Error("Missing algorithm parameter for jws.verify");throw n.code="MISSING_ALGORITHM",n}e=qe(e);var f=Be(e),a=vr(e),s=ur(r);return s.verify(a,f,t)}function Ie(e,r){if(r=r||{},e=qe(e),!_e(e))return null;var t=Ae(e);if(!t)return null;var n=Sr(e);if(t.typ==="JWT"||r.json)n=JSON.parse(n,r.encoding);return{header:t,payload:n,signature:Be(e)}}function w(e){e=e||{};var r=e.secret;if(r=r==null?e.publicKey:r,r=r==null?e.key:r,/^hs/i.test(e.algorithm)===!0&&r==null)throw TypeError("secret must be a string or buffer or a KeyObject");var t=new we(r);this.readable=!0,this.algorithm=e.algorithm,this.encoding=e.encoding,this.secret=this.publicKey=this.key=t,this.signature=new we(e.signature),this.secret.once("close",function(){if(!this.signature.writable&&this.readable)this.verify()}.bind(this)),this.signature.once("close",function(){if(!this.secret.writable&&this.readable)this.verify()}.bind(this))}cr.inherits(w,sr);w.prototype.verify=function(){try{var r=Te(this.signature.buffer,this.algorithm,this.key.buffer),t=Ie(this.signature.buffer,this.encoding);return this.emit("done",r,t),this.emit("data",r),this.emit("end"),this.readable=!1,r}catch(n){this.readable=!1,this.emit("error",n),this.emit("close")}};w.decode=Ie;w.isValid=_e;w.verify=Te;xe.exports=w});var gc=i(function(dr){var Le=be(),O=Pe(),yr=["HS256","HS384","HS512","RS256","RS384","RS512","PS256","PS384","PS512","ES256","ES384","ES512"];dr.ALGORITHMS=yr;dr.sign=Le.sign;dr.verify=O.verify;dr.decode=O.decode;dr.isValid=O.isValid;dr.createSign=function(r){return new Le(r)};dr.createVerify=function(r){return new O(r)}});
|
|
4
|
+
export{hc,xy,gc};
|