@standardagents/builder 0.11.0-next.5d2e71b → 0.11.0-next.730b472

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.
@@ -5821,9 +5821,12 @@ var agents_get_default = defineController(async ({ agents, agentNames }) => {
5821
5821
  name: definition.name,
5822
5822
  title: definition.title || definition.name,
5823
5823
  type: definition.type || "ai_human",
5824
- default_prompt: definition.defaultPrompt || "",
5825
- default_model: definition.defaultModel || "",
5826
- tools: definition.tools || [],
5824
+ // Use sideA.prompt as the default prompt (new structure)
5825
+ default_prompt: definition.sideA?.prompt || "",
5826
+ // Model is now specified in the prompt definition, not the agent
5827
+ default_model: "",
5828
+ // Tools are now specified in the prompt definition, not the agent
5829
+ tools: [],
5827
5830
  side_a_agent_prompt: definition.sideA?.prompt || null,
5828
5831
  side_b_agent_prompt: definition.sideB?.prompt || null,
5829
5832
  created_at: Math.floor(Date.now() / 1e3)
@@ -6022,6 +6025,12 @@ function base64ToBuffer(base64) {
6022
6025
  }
6023
6026
 
6024
6027
  // src/middleware/auth.ts
6028
+ var CORS_HEADERS = {
6029
+ "Access-Control-Allow-Origin": "*",
6030
+ "Access-Control-Allow-Methods": "GET, POST, PUT, DELETE, PATCH, OPTIONS",
6031
+ "Access-Control-Allow-Headers": "Content-Type, Authorization, X-Requested-With",
6032
+ "Access-Control-Max-Age": "86400"
6033
+ };
6025
6034
  function extractBearerToken(request) {
6026
6035
  const authHeader = request.headers.get("Authorization");
6027
6036
  if (authHeader && authHeader.startsWith("Bearer ")) {
@@ -6110,7 +6119,7 @@ async function requireAuth(request, env) {
6110
6119
  if (!authContext) {
6111
6120
  return new Response(JSON.stringify({ error: "Unauthorized" }), {
6112
6121
  status: 401,
6113
- headers: { "Content-Type": "application/json" }
6122
+ headers: { "Content-Type": "application/json", ...CORS_HEADERS }
6114
6123
  });
6115
6124
  }
6116
6125
  return authContext;
@@ -6125,7 +6134,7 @@ async function requireAdmin(request, env) {
6125
6134
  JSON.stringify({ error: "Forbidden: Admin access required" }),
6126
6135
  {
6127
6136
  status: 403,
6128
- headers: { "Content-Type": "application/json" }
6137
+ headers: { "Content-Type": "application/json", ...CORS_HEADERS }
6129
6138
  }
6130
6139
  );
6131
6140
  }