@zuplo/runtime 7.9.15 → 7.9.17
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/out/esm/{chunk-CBNXKT6K.js → chunk-UJ56MYSD.js} +86 -86
- package/out/esm/chunk-UJ56MYSD.js.map +1 -0
- package/out/esm/index.js +1 -1
- package/out/esm/mcp-gateway/index.js +1 -1
- package/out/esm/mocks/index.js +1 -1
- package/out/types/index.d.ts +9 -6
- package/package.json +1 -1
- package/out/esm/chunk-CBNXKT6K.js.map +0 -1
- /package/out/esm/{chunk-CBNXKT6K.js.LEGAL.txt → chunk-UJ56MYSD.js.LEGAL.txt} +0 -0
package/out/esm/mocks/index.js
CHANGED
|
@@ -22,5 +22,5 @@
|
|
|
22
22
|
* DEALINGS IN THE SOFTWARE.
|
|
23
23
|
*--------------------------------------------------------------------------------------------*/
|
|
24
24
|
|
|
25
|
-
import{E as p,J as c,M as u}from"../chunk-
|
|
25
|
+
import{E as p,J as c,M as u}from"../chunk-UJ56MYSD.js";import"../chunk-VTO3F6DK.js";import{a as d}from"../chunk-QGAJTUPE.js";import"../chunk-A3QGJZO7.js";import"../chunk-YJ2BHVUH.js";import{aa as i}from"../chunk-PBDT4FDO.js";import{a as o}from"../chunk-TYV53J3B.js";function w(l={request:new Request("https://api.example.com")}){let e=[];function t(s){e.push(Promise.resolve(s))}return o(t,"waitUntil"),{context:new a({event:{waitUntil:t},route:l.route,originalRequest:l.request}),invokeResponse:o(async()=>{await Promise.all(e)},"invokeResponse")}}o(w,"createMockContext");var g={path:"/",methods:["GET"],handler:{module:{},export:"default"},raw:o(()=>({}),"raw")},a=class extends EventTarget{static{o(this,"MockZuploContext")}#e;#t;contextId;requestId;log;route;custom;incomingRequestProperties;parentContext;analyticsContext;constructor({event:e,route:t=g,parentContext:n,originalRequest:r}){super(),this.requestId=crypto.randomUUID(),this.contextId=crypto.randomUUID(),this.log={info:i.console.info,log:i.console.log,debug:i.console.debug,warn:i.console.warn,error:i.console.error,setLogProperties:o(()=>{},"setLogProperties")},this.custom={},this.route=t,this.incomingRequestProperties={ip:"203.0.113.7",asn:1234,asOrganization:"ORGANIZATION",city:"Seattle",region:"Washington",regionCode:"WA",colo:"SEA",continent:"NA",country:"US",postalCode:"98004",metroCode:"SEA",latitude:void 0,longitude:void 0,timezone:void 0,httpProtocol:void 0,clientCert:void 0,clientMtlsVerificationStatus:void 0,clientMtlsVerificationReason:void 0,clientCertFingerprintSha256:void 0,clientCertNotBefore:void 0,clientCertNotAfter:void 0,clientCertIssuerDn:void 0,clientCertSubjectDn:void 0},this.parentContext=n,this.#e=e,this.#t=r,this.analyticsContext=new c(this.requestId)}waitUntil(e){this.#e.waitUntil(e)}invokeInboundPolicy(e,t){throw new Error("Not implemented")}invokeOutboundPolicy(e,t,n){throw new Error("Not implemented")}invokeRoute(e,t){throw new Error("Not implemented")}addResponseSendingHook(e){throw new Error("Not implemented")}addResponseSendingFinalHook(e){throw new Error("Not implemented")}addPreRequestHandler(e,t){let n;try{n=u.getContextExtensions(this)}catch{n=u.initialize(this,new d(this.#t??new Request("https://api.example.com")))}n.preRequestPhase??="active",p(this,n,e,t)}get preRequestHandlers(){let e;try{e=u.getContextExtensions(this)}catch{return[]}return(e.preRequestState?.entries??[]).map(t=>({policyName:t.policyName,name:t.name}))}addEventListener(e,t,n){let r=o(s=>{try{typeof t=="function"?t(s):t.handleEvent(s)}catch(m){throw this.log.error(`Error invoking event ${e}. See following logs for details.`),m}},"wrapped");super.addEventListener(e,r,n)}};export{a as MockZuploContext,w as createMockContext};
|
|
26
26
|
//# sourceMappingURL=index.js.map
|
package/out/types/index.d.ts
CHANGED
|
@@ -3779,7 +3779,7 @@ declare type Claim = string;
|
|
|
3779
3779
|
declare type ClaimCheck = EqualsRule | InRule | StartsWithRule;
|
|
3780
3780
|
|
|
3781
3781
|
/**
|
|
3782
|
-
* Where the prompt is classified. Set
|
|
3782
|
+
* Where the prompt is classified. Set `app.adapter` to select the API that classifier app exposes.
|
|
3783
3783
|
* @public
|
|
3784
3784
|
*/
|
|
3785
3785
|
declare interface Classifier {
|
|
@@ -3800,10 +3800,13 @@ declare interface ClassifierApp {
|
|
|
3800
3800
|
}
|
|
3801
3801
|
|
|
3802
3802
|
/**
|
|
3803
|
-
* API contract exposed by the classifier app.
|
|
3803
|
+
* API contract exposed by the classifier app. `chat-completions` calls /v1/chat/completions; `messages` calls /v1/messages for Claude models that support structured outputs (`output_config.format`), such as `claude-haiku-4-5`, on a provider whose Messages endpoint accepts them (not Amazon Bedrock Mantle); `system-one` calls /v1/systemone for models such as Jev. The app owns provider credentials, pricing, metering and analytics.
|
|
3804
3804
|
* @public
|
|
3805
3805
|
*/
|
|
3806
|
-
declare type ClassifierAppAdapter =
|
|
3806
|
+
declare type ClassifierAppAdapter =
|
|
3807
|
+
| "chat-completions"
|
|
3808
|
+
| "messages"
|
|
3809
|
+
| "system-one";
|
|
3807
3810
|
|
|
3808
3811
|
/**
|
|
3809
3812
|
* API key sent as `Authorization: Bearer` when invoking the classifier app. Omit it when the classifier app runs the Internal Only policy: the classifier call never leaves the gateway, so that policy accepts it and rejects everything arriving over the network, and no credential is sent. Set it only when the classifier app authenticates callers with API keys.
|
|
@@ -3842,7 +3845,7 @@ declare type ClassifierAppIDDeprecated = string;
|
|
|
3842
3845
|
declare type ClassifierModel = string;
|
|
3843
3846
|
|
|
3844
3847
|
/**
|
|
3845
|
-
* The model (`providerName/model`) the classifier app uses to evaluate the user's request. `providerName` is the name of the provider as configured on the classifier app, not a fixed vendor id. E.g. `openai/gpt-4o-mini`, or `jev/jev-latest` when the Jev provider is named `jev`.
|
|
3848
|
+
* The model (`providerName/model`) the classifier app uses to evaluate the user's request. `providerName` is the name of the provider as configured on the classifier app, not a fixed vendor id. E.g. `openai/gpt-4o-mini`, `anthropic/claude-haiku-4-5` with the `messages` adapter, or `jev/jev-latest` when the Jev provider is named `jev`.
|
|
3846
3849
|
* @public
|
|
3847
3850
|
*/
|
|
3848
3851
|
declare type ClassifierModel_2 = string;
|
|
@@ -3860,7 +3863,7 @@ declare type ClassifierModelDeprecated = string;
|
|
|
3860
3863
|
declare type ClassifierPrompt = string | [string, ...string[]];
|
|
3861
3864
|
|
|
3862
3865
|
/**
|
|
3863
|
-
* Prompt for classifier.app (its default or
|
|
3866
|
+
* Prompt for classifier.app (its default `chat-completions` adapter or the `messages` adapter, where it is sent as the system prompt) and classifier.chatCompletions. Omit to use the built-in prompt. classifier.app.adapter `system-one` and classifier.jev take no prompt; combining them with classifierPrompt is a configuration error.
|
|
3864
3867
|
* @public
|
|
3865
3868
|
*/
|
|
3866
3869
|
declare type ClassifierPrompt_2 = string | [string, ...string[]];
|
|
@@ -8258,7 +8261,7 @@ declare type JevModel = string;
|
|
|
8258
8261
|
|
|
8259
8262
|
/**
|
|
8260
8263
|
* @deprecated
|
|
8261
|
-
* Deprecated: use `classifier.app` with `adapter` `
|
|
8264
|
+
* Deprecated: use `classifier.app` with `adapter` `system-one` instead. Classify with Jev, TypeSafe's classification model, by calling a System One API directly: TypeSafe's by default, or another host such as OpenRouter through `baseUrl`. Jev answers typed questions instead of generating text, so it takes no `classifierPrompt`.
|
|
8262
8265
|
* @public
|
|
8263
8266
|
*/
|
|
8264
8267
|
declare interface JevTypeSafe {
|