@standardagents/builder 0.17.0 → 0.17.1
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 +330 -45
- package/dist/built-in-routes.js.map +1 -1
- package/dist/client/ThreadInspectorPane.vue_vue_type_script_setup_true_lang.js +15 -19
- package/dist/client/assets/ThreadInspectorPane.css +1 -1
- package/dist/client/assets/img/favicon.svg +10 -2
- package/dist/{index-BnrKzXpJ.d.ts → index-Dx1js-H1.d.ts} +22 -0
- package/dist/index.d.ts +1 -1
- package/dist/index.js +244 -41
- package/dist/index.js.map +1 -1
- package/dist/plugin.js +42 -0
- package/dist/plugin.js.map +1 -1
- package/dist/runtime.d.ts +2 -2
- package/dist/runtime.js +202 -41
- package/dist/runtime.js.map +1 -1
- package/dist/test.d.ts +1 -1
- package/package.json +4 -4
package/dist/plugin.js
CHANGED
|
@@ -6539,6 +6539,18 @@ function readRawRequestBody(req) {
|
|
|
6539
6539
|
req.on("error", reject);
|
|
6540
6540
|
});
|
|
6541
6541
|
}
|
|
6542
|
+
function resolveContainedFile(baseDir, requestPath) {
|
|
6543
|
+
const resolvedBase = path8__default.resolve(baseDir);
|
|
6544
|
+
const resolved = path8__default.resolve(resolvedBase, `.${path8__default.sep}${requestPath.replace(/^\/+/, "")}`);
|
|
6545
|
+
if (resolved !== resolvedBase && !resolved.startsWith(resolvedBase + path8__default.sep)) {
|
|
6546
|
+
return null;
|
|
6547
|
+
}
|
|
6548
|
+
try {
|
|
6549
|
+
return fs8__default.existsSync(resolved) && fs8__default.statSync(resolved).isFile() ? resolved : null;
|
|
6550
|
+
} catch {
|
|
6551
|
+
return null;
|
|
6552
|
+
}
|
|
6553
|
+
}
|
|
6542
6554
|
function injectUiConfigIntoHtml(htmlContent) {
|
|
6543
6555
|
const configScript = `<script>window.__AGENTBUILDER_CONFIG__ = { devMode: true };</script>`;
|
|
6544
6556
|
return htmlContent.replace(/\/agents\//g, "/").replace("</head>", `${configScript}</head>`);
|
|
@@ -6681,6 +6693,15 @@ function createDevMiddleware(server, context) {
|
|
|
6681
6693
|
if (isStaticAsset) {
|
|
6682
6694
|
const cleanUrl = clientPath.split("?")[0];
|
|
6683
6695
|
filePath = path8__default.join(clientDir, cleanUrl);
|
|
6696
|
+
if (!fs8__default.existsSync(filePath)) {
|
|
6697
|
+
const projectPublicFile = resolveContainedFile(
|
|
6698
|
+
path8__default.resolve(server.config.root, "public"),
|
|
6699
|
+
cleanUrl
|
|
6700
|
+
);
|
|
6701
|
+
if (projectPublicFile) {
|
|
6702
|
+
filePath = projectPublicFile;
|
|
6703
|
+
}
|
|
6704
|
+
}
|
|
6684
6705
|
} else {
|
|
6685
6706
|
filePath = path8__default.join(clientDir, "index.html");
|
|
6686
6707
|
}
|
|
@@ -7977,6 +7998,27 @@ export { CodeExecutionBridge, DurableAgentBuilder, DurableThread };
|
|
|
7977
7998
|
}
|
|
7978
7999
|
}
|
|
7979
8000
|
copyRecursive(clientDir, mountDir);
|
|
8001
|
+
const projectPublicDir = path8__default.resolve(process.cwd(), "public");
|
|
8002
|
+
if (fs8__default.existsSync(projectPublicDir)) {
|
|
8003
|
+
let copyPublicRecursive2 = function(src, dest) {
|
|
8004
|
+
const entries = fs8__default.readdirSync(src, { withFileTypes: true });
|
|
8005
|
+
for (const entry of entries) {
|
|
8006
|
+
const srcPath = path8__default.join(src, entry.name);
|
|
8007
|
+
const destPath = path8__default.join(dest, entry.name);
|
|
8008
|
+
if (entry.isDirectory()) {
|
|
8009
|
+
fs8__default.mkdirSync(destPath, { recursive: true });
|
|
8010
|
+
copyPublicRecursive2(srcPath, destPath);
|
|
8011
|
+
} else if (fs8__default.existsSync(destPath)) {
|
|
8012
|
+
console.warn(
|
|
8013
|
+
`[agentbuilder] Skipping public/ file that collides with a built UI asset: ${destPath}`
|
|
8014
|
+
);
|
|
8015
|
+
} else {
|
|
8016
|
+
fs8__default.copyFileSync(srcPath, destPath);
|
|
8017
|
+
}
|
|
8018
|
+
}
|
|
8019
|
+
};
|
|
8020
|
+
copyPublicRecursive2(projectPublicDir, mountDir);
|
|
8021
|
+
}
|
|
7980
8022
|
}
|
|
7981
8023
|
};
|
|
7982
8024
|
return [
|