@economic/agents 2.8.0 → 2.8.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.d.mts +2 -2
- package/dist/index.mjs +2 -2
- package/dist/{route-agent-request-8C2T8Mu0.d.mts → route-agent-request-9vqbi1bt.d.mts} +3 -2
- package/dist/{route-agent-request-CYclS_5Q.mjs → route-agent-request-CFDjDTV-.mjs} +4 -1
- package/dist/v1.d.mts +1 -1
- package/dist/v1.mjs +1 -1
- package/package.json +1 -1
package/dist/index.d.mts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { n as JwtAuthConfig, t as routeAgentRequest } from "./route-agent-request-
|
|
1
|
+
import { n as JwtAuthConfig, r as createJwtAuthConfig, t as routeAgentRequest } from "./route-agent-request-9vqbi1bt.mjs";
|
|
2
2
|
import { Agent as Agent$1, Connection, ConnectionContext, SubAgentClass } from "agents";
|
|
3
3
|
import { ChatResponseResult, PrepareStepContext, Session, Think, ToolCallContext, ToolCallDecision, TurnConfig, TurnContext, skills } from "@cloudflare/think";
|
|
4
4
|
import { JSONValue, LanguageModel, ModelMessage, Tool as Tool$1, UIMessage } from "ai";
|
|
@@ -372,4 +372,4 @@ declare function skill<Context extends Record<string, unknown> = Record<string,
|
|
|
372
372
|
//#region src/server/index.d.ts
|
|
373
373
|
declare function getCurrentToolContext(): any;
|
|
374
374
|
//#endregion
|
|
375
|
-
export { Agent, type AgentConnectionStatus, type AgentConnectionType, type AgentEnv, Assistant, ChatAgent, type ExchangedToken, type Skill, type SkillSource, type TokenExchangeConfig, type TokenExchangeResult, type Tool, type ToolContext, type ToolSet, type TurnSnapshot, exchangeToken, getCurrentToolContext, routeAgentRequest, skill, tool };
|
|
375
|
+
export { Agent, type AgentConnectionStatus, type AgentConnectionType, type AgentEnv, Assistant, ChatAgent, type ExchangedToken, type JwtAuthConfig, type Skill, type SkillSource, type TokenExchangeConfig, type TokenExchangeResult, type Tool, type ToolContext, type ToolSet, type TurnSnapshot, createJwtAuthConfig, exchangeToken, getCurrentToolContext, routeAgentRequest, skill, tool };
|
package/dist/index.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { a as
|
|
1
|
+
import { a as extractTokenFromConnectRequest, i as createJwtAuthConfig, n as createAgentTracer, o as isJwtActorAuthorized, r as recordFeedbackAnalytics, s as verifyJwt, t as routeAgentRequest } from "./route-agent-request-CFDjDTV-.mjs";
|
|
2
2
|
import { Agent as Agent$1, callable, getCurrentAgent } from "agents";
|
|
3
3
|
import { Think, skills } from "@cloudflare/think";
|
|
4
4
|
import { Output, convertToModelMessages, generateText, jsonSchema, pruneMessages, tool as tool$1 } from "ai";
|
|
@@ -1450,4 +1450,4 @@ function getCurrentToolContext() {
|
|
|
1450
1450
|
return getCurrentAgent().agent._lastBody;
|
|
1451
1451
|
}
|
|
1452
1452
|
//#endregion
|
|
1453
|
-
export { Agent, Assistant, ChatAgent, exchangeToken, getCurrentToolContext, routeAgentRequest, skill, tool };
|
|
1453
|
+
export { Agent, Assistant, ChatAgent, createJwtAuthConfig, exchangeToken, getCurrentToolContext, routeAgentRequest, skill, tool };
|
|
@@ -14,10 +14,11 @@ interface JwtAuthConfig<TClaims extends Record<string, unknown> = Record<string,
|
|
|
14
14
|
*/
|
|
15
15
|
getClaims: (payload: Record<string, unknown>) => TClaims;
|
|
16
16
|
/** Derive the actor ID represented by the verified claims. */
|
|
17
|
-
getActorId
|
|
17
|
+
getActorId(claims: TClaims): string;
|
|
18
18
|
}
|
|
19
|
+
declare function createJwtAuthConfig<TClaims extends Record<string, unknown>>(config: JwtAuthConfig<TClaims>): JwtAuthConfig<TClaims>;
|
|
19
20
|
//#endregion
|
|
20
21
|
//#region src/server/route-agent-request.d.ts
|
|
21
22
|
declare function routeAgentRequest$1<Env>(request: Request, env: Env, options?: AgentOptions<Env>): Promise<Response | null>;
|
|
22
23
|
//#endregion
|
|
23
|
-
export { JwtAuthConfig as n, routeAgentRequest$1 as t };
|
|
24
|
+
export { JwtAuthConfig as n, createJwtAuthConfig as r, routeAgentRequest$1 as t };
|
|
@@ -2,6 +2,9 @@ import { routeAgentRequest } from "agents";
|
|
|
2
2
|
import { createRemoteJWKSet, decodeJwt, errors, jwtVerify } from "jose";
|
|
3
3
|
import { BasicTracerProvider, SimpleSpanProcessor } from "@opentelemetry/sdk-trace-base";
|
|
4
4
|
//#region src/server/features/auth/index.ts
|
|
5
|
+
function createJwtAuthConfig(config) {
|
|
6
|
+
return config;
|
|
7
|
+
}
|
|
5
8
|
const jwksByIssuer = /* @__PURE__ */ new Map();
|
|
6
9
|
/** Returns the actor portion of a top-level or parent-scoped agent name. */
|
|
7
10
|
function getTargetActorId(target) {
|
|
@@ -477,4 +480,4 @@ async function routeAgentRequest$1(request, env, options) {
|
|
|
477
480
|
return response;
|
|
478
481
|
}
|
|
479
482
|
//#endregion
|
|
480
|
-
export {
|
|
483
|
+
export { extractTokenFromConnectRequest as a, createJwtAuthConfig as i, createAgentTracer as n, isJwtActorAuthorized as o, recordFeedbackAnalytics as r, verifyJwt as s, routeAgentRequest$1 as t };
|
package/dist/v1.d.mts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { n as JwtAuthConfig, t as routeAgentRequest } from "./route-agent-request-
|
|
1
|
+
import { n as JwtAuthConfig, t as routeAgentRequest } from "./route-agent-request-9vqbi1bt.mjs";
|
|
2
2
|
import { Agent as Agent$1, Connection, ConnectionContext } from "agents";
|
|
3
3
|
import { LanguageModel, StreamTextOnFinishCallback, ToolSet, UIMessage, generateText, streamText } from "ai";
|
|
4
4
|
import { AIChatAgent, ChatResponseResult, OnChatMessageOptions } from "@cloudflare/ai-chat";
|
package/dist/v1.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { a as
|
|
1
|
+
import { a as extractTokenFromConnectRequest, n as createAgentTracer, o as isJwtActorAuthorized, s as verifyJwt, t as routeAgentRequest } from "./route-agent-request-CFDjDTV-.mjs";
|
|
2
2
|
import { Agent as Agent$1, callable, getCurrentAgent } from "agents";
|
|
3
3
|
import { Output, convertToModelMessages, generateText, jsonSchema, stepCountIs, streamText, tool } from "ai";
|
|
4
4
|
import { AIChatAgent } from "@cloudflare/ai-chat";
|