@standardagents/builder 0.40.3 → 0.40.5-next.3b25e2a
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/built-in-routes.js +31 -8
- package/dist/built-in-routes.js.map +1 -1
- package/dist/index.js +56 -31
- package/dist/index.js.map +1 -1
- package/dist/plugin.d.ts +2 -0
- package/dist/plugin.js +15 -2
- package/dist/plugin.js.map +1 -1
- package/dist/runtime.d.ts +1 -0
- package/dist/runtime.js +41 -29
- package/dist/runtime.js.map +1 -1
- package/package.json +5 -5
package/dist/built-in-routes.js
CHANGED
|
@@ -68899,7 +68899,7 @@ var config_get_default = defineController2(async ({ config, env: env2, req }) =>
|
|
|
68899
68899
|
});
|
|
68900
68900
|
|
|
68901
68901
|
// src/version.ts
|
|
68902
|
-
var BUILDER_VERSION = "0.40.
|
|
68902
|
+
var BUILDER_VERSION = "0.40.5-next.3b25e2a".length > 0 ? "0.40.5-next.3b25e2a" : "dev";
|
|
68903
68903
|
|
|
68904
68904
|
// src/api/diagnostics.get.ts
|
|
68905
68905
|
init_LLMRequest();
|
|
@@ -75494,8 +75494,11 @@ var tool_result_post_default = defineController2(async ({ req, params, env: env2
|
|
|
75494
75494
|
if (!delivered) {
|
|
75495
75495
|
return Response.json({ status: "ignored" }, { status: 200 });
|
|
75496
75496
|
}
|
|
75497
|
-
|
|
75498
|
-
|
|
75497
|
+
if (delivered.resume) {
|
|
75498
|
+
await stub.continueExecution(threadId, delivered.side);
|
|
75499
|
+
return Response.json({ status: "resumed", side: delivered.side }, { status: 200 });
|
|
75500
|
+
}
|
|
75501
|
+
return Response.json({ status: "delivered", side: delivered.side }, { status: 200 });
|
|
75499
75502
|
} catch (error) {
|
|
75500
75503
|
console.error(`Error delivering tool result for thread ${threadId}:`, error);
|
|
75501
75504
|
return Response.json(
|
|
@@ -76358,16 +76361,29 @@ async function resolveDeviceApprovalBrand(env2, config) {
|
|
|
76358
76361
|
}
|
|
76359
76362
|
return configured ?? BUILT_IN_DEVICE_APPROVAL_BRAND;
|
|
76360
76363
|
}
|
|
76361
|
-
function
|
|
76364
|
+
function deviceOutcomeOrigin(env2) {
|
|
76365
|
+
const raw = env2.STANDARD_AGENTS_DEVICE_OUTCOME_URL_BASE;
|
|
76366
|
+
if (typeof raw !== "string" || !raw.trim()) return null;
|
|
76367
|
+
try {
|
|
76368
|
+
const target = new URL(raw.trim());
|
|
76369
|
+
if (target.protocol !== "https:" || target.username || target.password) return null;
|
|
76370
|
+
return target.origin;
|
|
76371
|
+
} catch {
|
|
76372
|
+
return null;
|
|
76373
|
+
}
|
|
76374
|
+
}
|
|
76375
|
+
function approvalCsp(req, brand, env2) {
|
|
76362
76376
|
let imageSource = "";
|
|
76363
76377
|
if (brand.logoUrl) {
|
|
76364
76378
|
const requestOrigin = new URL(req.url).origin;
|
|
76365
76379
|
const logoOrigin = new URL(brand.logoUrl, requestOrigin).origin;
|
|
76366
76380
|
imageSource = `; img-src ${logoOrigin === requestOrigin ? "'self'" : logoOrigin}`;
|
|
76367
76381
|
}
|
|
76368
|
-
|
|
76382
|
+
const outcomeOrigin = deviceOutcomeOrigin(env2);
|
|
76383
|
+
const formAction = outcomeOrigin ? `'self' ${outcomeOrigin}` : "'self'";
|
|
76384
|
+
return `default-src 'none'; style-src 'unsafe-inline'; form-action ${formAction}; base-uri 'none'; frame-ancestors 'none'${imageSource}`;
|
|
76369
76385
|
}
|
|
76370
|
-
function confirmationPage(req, confirmationToken, handoff, brand, identity) {
|
|
76386
|
+
function confirmationPage(req, confirmationToken, handoff, brand, identity, env2) {
|
|
76371
76387
|
const handoffInput = handoff ? `<input type="hidden" name="handoff" value="${escapeHtml(handoff)}">` : "";
|
|
76372
76388
|
const logo = brand.logoUrl ? `<img class="logo" src="${escapeHtml(brand.logoUrl)}" alt="">` : `<span class="logo-fallback" aria-hidden="true">${escapeHtml(brand.name.slice(0, 1).toUpperCase())}</span>`;
|
|
76373
76389
|
const description = brand.description ? `<p class="description">${escapeHtml(brand.description)}</p>` : "";
|
|
@@ -76381,7 +76397,7 @@ function confirmationPage(req, confirmationToken, handoff, brand, identity) {
|
|
|
76381
76397
|
"Cache-Control": "no-store",
|
|
76382
76398
|
"Referrer-Policy": "no-referrer",
|
|
76383
76399
|
"X-Content-Type-Options": "nosniff",
|
|
76384
|
-
"Content-Security-Policy": approvalCsp(req, brand)
|
|
76400
|
+
"Content-Security-Policy": approvalCsp(req, brand, env2)
|
|
76385
76401
|
}
|
|
76386
76402
|
});
|
|
76387
76403
|
}
|
|
@@ -76531,7 +76547,14 @@ var approve_get_default = defineController2(async ({ req, env: env2, params, con
|
|
|
76531
76547
|
});
|
|
76532
76548
|
}
|
|
76533
76549
|
const brand = await resolveDeviceApprovalBrand(env2, config);
|
|
76534
|
-
return confirmationPage(
|
|
76550
|
+
return confirmationPage(
|
|
76551
|
+
req,
|
|
76552
|
+
confirmationToken,
|
|
76553
|
+
identity.handoff,
|
|
76554
|
+
brand,
|
|
76555
|
+
identity,
|
|
76556
|
+
env2
|
|
76557
|
+
);
|
|
76535
76558
|
});
|
|
76536
76559
|
|
|
76537
76560
|
// src/api/auth/device/[code]/approve.post.ts
|