@frontman-ai/astro 0.5.0 → 0.5.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.js +61 -22
- package/dist/integration.js +61 -22
- package/dist/toolbar.js +4 -3
- package/package.json +3 -8
package/dist/index.js
CHANGED
|
@@ -122,7 +122,7 @@ var clientCss = "https://app.frontman.sh/frontman.css";
|
|
|
122
122
|
var devClientJs = "http://localhost:5173/src/Main.res.mjs";
|
|
123
123
|
|
|
124
124
|
// src/FrontmanAstro__Config.res.mjs
|
|
125
|
-
var packageVersion = "0.5.
|
|
125
|
+
var packageVersion = "0.5.2" ;
|
|
126
126
|
var host = process.env["FRONTMAN_HOST"];
|
|
127
127
|
var defaultHost = host !== void 0 ? host : apiHost;
|
|
128
128
|
var ensureConfig = (function(c2) {
|
|
@@ -2684,6 +2684,7 @@ var defaultConfig_stdoutPatterns = [
|
|
|
2684
2684
|
"hmr",
|
|
2685
2685
|
"error",
|
|
2686
2686
|
"Error",
|
|
2687
|
+
"ERROR",
|
|
2687
2688
|
"astro",
|
|
2688
2689
|
"build"
|
|
2689
2690
|
];
|
|
@@ -2831,12 +2832,16 @@ function handleStdoutWrite(state, message4) {
|
|
|
2831
2832
|
}
|
|
2832
2833
|
function interceptStdout(_state) {
|
|
2833
2834
|
(function(_state2) {
|
|
2834
|
-
const
|
|
2835
|
-
|
|
2836
|
-
|
|
2837
|
-
|
|
2838
|
-
|
|
2835
|
+
const interceptStream = (stream) => {
|
|
2836
|
+
const originalWrite = stream.write.bind(stream);
|
|
2837
|
+
stream.write = (chunk, ...args) => {
|
|
2838
|
+
const message4 = typeof chunk === "string" ? chunk : chunk.toString();
|
|
2839
|
+
handleStdoutWrite(_state2, message4);
|
|
2840
|
+
return originalWrite(chunk, ...args);
|
|
2841
|
+
};
|
|
2839
2842
|
};
|
|
2843
|
+
interceptStream(process.stdout);
|
|
2844
|
+
interceptStream(process.stderr);
|
|
2840
2845
|
})(_state);
|
|
2841
2846
|
}
|
|
2842
2847
|
function interceptUncaughtErrors(state) {
|
|
@@ -6122,11 +6127,13 @@ function generateHTML(config) {
|
|
|
6122
6127
|
let clientCssTag = mapOr(config.clientCssUrl, "", (url2) => `<link rel="stylesheet" href="` + url2 + `">`);
|
|
6123
6128
|
let entrypointTemplate = mapOr(config.entrypointUrl, "", (url2) => `<script type="template" id="frontman-entrypoint-url">` + url2 + `</script>`);
|
|
6124
6129
|
let themeClass = config.isLightTheme ? "" : "dark";
|
|
6125
|
-
let
|
|
6130
|
+
let getEnvKey = (varName) => flatMap(process.env[varName], (key) => {
|
|
6126
6131
|
if (key !== "") {
|
|
6127
6132
|
return key;
|
|
6128
6133
|
}
|
|
6129
6134
|
});
|
|
6135
|
+
let openrouterKey = getEnvKey("OPENROUTER_API_KEY");
|
|
6136
|
+
let anthropicKey = getEnvKey("ANTHROPIC_API_KEY");
|
|
6130
6137
|
let configObj = Object.fromEntries([
|
|
6131
6138
|
[
|
|
6132
6139
|
"framework",
|
|
@@ -6148,6 +6155,9 @@ function generateHTML(config) {
|
|
|
6148
6155
|
forEach(openrouterKey, (key) => {
|
|
6149
6156
|
configObj["openrouterKeyValue"] = key;
|
|
6150
6157
|
});
|
|
6158
|
+
forEach(anthropicKey, (key) => {
|
|
6159
|
+
configObj["anthropicKeyValue"] = key;
|
|
6160
|
+
});
|
|
6151
6161
|
let payload = JSON.stringify(configObj);
|
|
6152
6162
|
let runtimeConfigScript = `<script>window.__frontmanRuntime=` + payload + `</script>`;
|
|
6153
6163
|
return `<!DOCTYPE html>
|
|
@@ -7814,6 +7824,13 @@ async function Te(o) {
|
|
|
7814
7824
|
}
|
|
7815
7825
|
}
|
|
7816
7826
|
|
|
7827
|
+
// ../frontman-protocol/src/FrontmanProtocol__Types.res.mjs
|
|
7828
|
+
enableJson2();
|
|
7829
|
+
var modelSelectionSchema = schema2((s2) => ({
|
|
7830
|
+
provider: s2.m(string2),
|
|
7831
|
+
value: s2.m(string2)
|
|
7832
|
+
}));
|
|
7833
|
+
|
|
7817
7834
|
// ../frontman-protocol/src/FrontmanProtocol__MCP.res.mjs
|
|
7818
7835
|
enableJson2();
|
|
7819
7836
|
var capabilitiesSchema = schema2((s2) => ({
|
|
@@ -7840,17 +7857,32 @@ schema2((s2) => ({
|
|
|
7840
7857
|
name: s2.m(string2),
|
|
7841
7858
|
arguments: s2.m(option2(dict2(json2)))
|
|
7842
7859
|
}));
|
|
7860
|
+
var toolResultContentTypeSchema = union2([
|
|
7861
|
+
literal2("text"),
|
|
7862
|
+
literal2("image"),
|
|
7863
|
+
literal2("resource")
|
|
7864
|
+
]);
|
|
7843
7865
|
var toolResultContentSchema = schema2((s2) => ({
|
|
7844
|
-
type: s2.m(
|
|
7866
|
+
type: s2.m(toolResultContentTypeSchema),
|
|
7845
7867
|
text: s2.m(string2)
|
|
7846
7868
|
}));
|
|
7847
7869
|
schema2((s2) => ({
|
|
7848
7870
|
code: s2.m(int2),
|
|
7849
7871
|
message: s2.m(string2)
|
|
7850
7872
|
}));
|
|
7873
|
+
var callToolResultMetaSchema = schema2((s2) => ({
|
|
7874
|
+
model: s2.m(option2(modelSelectionSchema)),
|
|
7875
|
+
envApiKey: s2.m(dict2(string2))
|
|
7876
|
+
}));
|
|
7877
|
+
var emptyMeta_envApiKey = {};
|
|
7878
|
+
var emptyMeta = {
|
|
7879
|
+
model: void 0,
|
|
7880
|
+
envApiKey: emptyMeta_envApiKey
|
|
7881
|
+
};
|
|
7851
7882
|
var callToolResultSchema = schema2((s2) => ({
|
|
7852
7883
|
content: s2.m(array2(toolResultContentSchema)),
|
|
7853
|
-
isError: s2.m(option2(bool2))
|
|
7884
|
+
isError: s2.m(option2(bool2)),
|
|
7885
|
+
_meta: s2.m(callToolResultMetaSchema)
|
|
7854
7886
|
}));
|
|
7855
7887
|
schema2((s2) => ({
|
|
7856
7888
|
tools: s2.m(array2(json2))
|
|
@@ -7933,7 +7965,8 @@ async function executeTool(registry, ctx2, name15, $$arguments) {
|
|
|
7933
7965
|
type: "text",
|
|
7934
7966
|
text: result._0
|
|
7935
7967
|
}],
|
|
7936
|
-
isError: true
|
|
7968
|
+
isError: true,
|
|
7969
|
+
_meta: emptyMeta
|
|
7937
7970
|
}
|
|
7938
7971
|
};
|
|
7939
7972
|
}
|
|
@@ -7945,7 +7978,8 @@ async function executeTool(registry, ctx2, name15, $$arguments) {
|
|
|
7945
7978
|
type: "text",
|
|
7946
7979
|
text: JSON.stringify(outputJson)
|
|
7947
7980
|
}],
|
|
7948
|
-
isError: void 0
|
|
7981
|
+
isError: void 0,
|
|
7982
|
+
_meta: emptyMeta
|
|
7949
7983
|
}
|
|
7950
7984
|
};
|
|
7951
7985
|
} catch (raw_e) {
|
|
@@ -7973,7 +8007,8 @@ function resultToMCP(result) {
|
|
|
7973
8007
|
type: "text",
|
|
7974
8008
|
text: `Tool not found: ` + result._0
|
|
7975
8009
|
}],
|
|
7976
|
-
isError: true
|
|
8010
|
+
isError: true,
|
|
8011
|
+
_meta: emptyMeta
|
|
7977
8012
|
};
|
|
7978
8013
|
case "InvalidInput":
|
|
7979
8014
|
return {
|
|
@@ -7981,7 +8016,8 @@ function resultToMCP(result) {
|
|
|
7981
8016
|
type: "text",
|
|
7982
8017
|
text: `Invalid input: ` + result._0
|
|
7983
8018
|
}],
|
|
7984
|
-
isError: true
|
|
8019
|
+
isError: true,
|
|
8020
|
+
_meta: emptyMeta
|
|
7985
8021
|
};
|
|
7986
8022
|
case "ExecutionError":
|
|
7987
8023
|
return {
|
|
@@ -7989,7 +8025,8 @@ function resultToMCP(result) {
|
|
|
7989
8025
|
type: "text",
|
|
7990
8026
|
text: `Execution error: ` + result._0
|
|
7991
8027
|
}],
|
|
7992
|
-
isError: true
|
|
8028
|
+
isError: true,
|
|
8029
|
+
_meta: emptyMeta
|
|
7993
8030
|
};
|
|
7994
8031
|
}
|
|
7995
8032
|
}
|
|
@@ -8078,7 +8115,8 @@ async function handleToolCall(registry, config, req) {
|
|
|
8078
8115
|
let errorResult_isError2 = true;
|
|
8079
8116
|
let errorResult2 = {
|
|
8080
8117
|
content: errorResult_content2,
|
|
8081
|
-
isError: errorResult_isError2
|
|
8118
|
+
isError: errorResult_isError2,
|
|
8119
|
+
_meta: emptyMeta
|
|
8082
8120
|
};
|
|
8083
8121
|
controller.enqueue(encoder.encode(errorEvent(errorResult2)));
|
|
8084
8122
|
controller.close();
|
|
@@ -8097,7 +8135,8 @@ async function handleToolCall(registry, config, req) {
|
|
|
8097
8135
|
let errorResult_isError = true;
|
|
8098
8136
|
let errorResult = {
|
|
8099
8137
|
content: errorResult_content,
|
|
8100
|
-
isError: errorResult_isError
|
|
8138
|
+
isError: errorResult_isError,
|
|
8139
|
+
_meta: emptyMeta
|
|
8101
8140
|
};
|
|
8102
8141
|
let json3 = reverseConvertToJsonOrThrow2(errorResult, callToolResultSchema);
|
|
8103
8142
|
return Response.json(json3, {
|
|
@@ -8205,19 +8244,19 @@ function isFrontmanRoute(pathname, basePath, method) {
|
|
|
8205
8244
|
function getCanonicalRedirect(prefixPath, basePath) {
|
|
8206
8245
|
let suffix = "/" + basePath;
|
|
8207
8246
|
if (prefixPath === basePath) {
|
|
8208
|
-
return "/" + basePath;
|
|
8247
|
+
return "/" + basePath + "/";
|
|
8209
8248
|
}
|
|
8210
8249
|
if (prefixPath.endsWith(suffix)) {
|
|
8211
8250
|
let stripped = prefixPath.slice(0, prefixPath.length - suffix.length | 0);
|
|
8212
8251
|
let cleanPrefix = stripped === "" ? "" : stripped;
|
|
8213
|
-
let tmp = cleanPrefix === "" ? "/" + basePath : "/" + cleanPrefix + "/" + basePath;
|
|
8252
|
+
let tmp = cleanPrefix === "" ? "/" + basePath + "/" : "/" + cleanPrefix + "/" + basePath + "/";
|
|
8214
8253
|
return tmp;
|
|
8215
8254
|
}
|
|
8216
8255
|
if (!prefixPath.startsWith(basePath + "/")) {
|
|
8217
8256
|
return;
|
|
8218
8257
|
}
|
|
8219
|
-
let rest = prefixPath.slice(basePath.length + 1 | 0);
|
|
8220
|
-
let tmp$1 = rest === "" ? "/" + basePath : "/" + rest + "/" + basePath;
|
|
8258
|
+
let rest = prefixPath.slice(basePath.length + 1 | 0, prefixPath.length);
|
|
8259
|
+
let tmp$1 = rest === "" ? "/" + basePath + "/" : "/" + rest + "/" + basePath + "/";
|
|
8221
8260
|
return tmp$1;
|
|
8222
8261
|
}
|
|
8223
8262
|
function buildEntrypointUrl(config, requestUrl, prefixPath) {
|
|
@@ -8227,7 +8266,7 @@ function buildEntrypointUrl(config, requestUrl, prefixPath) {
|
|
|
8227
8266
|
}
|
|
8228
8267
|
let url2 = new URL(requestUrl);
|
|
8229
8268
|
let origin = url2.origin;
|
|
8230
|
-
let pagePath = prefixPath === "" ? "/" : "/" + prefixPath;
|
|
8269
|
+
let pagePath = prefixPath === "" ? "/" : "/" + prefixPath + "/";
|
|
8231
8270
|
return origin + pagePath;
|
|
8232
8271
|
}
|
|
8233
8272
|
function createMiddleware(config, registry) {
|
|
@@ -8423,7 +8462,7 @@ function adaptToConnect(middleware, basePath) {
|
|
|
8423
8462
|
|
|
8424
8463
|
// src/FrontmanAstro__Integration.res.mjs
|
|
8425
8464
|
var annotationCaptureScript2 = annotationCaptureScript;
|
|
8426
|
-
var icon = `<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="
|
|
8465
|
+
var icon = `<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="90 70 230 270" fill="none"><path d="M145.925 316.925C136.175 316.925 129.242 315.517 125.125 312.7C121.008 309.667 118.517 305.875 117.65 301.325C116.783 296.558 116.35 291.792 116.35 287.025V119C116.35 107.733 118.517 100.042 122.85 95.925C127.4 91.5917 135.417 89.425 146.9 89.425H265.85C270.833 89.425 275.492 89.8583 279.825 90.725C284.375 91.5917 288.058 94.0833 290.875 98.2C293.692 102.317 295.1 109.358 295.1 119.325C295.1 129.075 293.583 136.008 290.55 140.125C287.733 144.242 284.05 146.733 279.5 147.6C274.95 148.467 270.183 148.9 265.2 148.9H175.825V177.825H235.625C240.608 177.825 245.05 178.258 248.95 179.125C253.067 179.775 256.208 181.942 258.375 185.625C260.758 189.092 261.95 195.158 261.95 203.825C261.95 212.058 260.758 217.908 258.375 221.375C255.992 224.842 252.742 226.9 248.625 227.55C244.725 228.2 240.283 228.525 235.3 228.525H175.825V287.35C175.825 292.117 175.392 296.775 174.525 301.325C173.658 305.875 171.167 309.667 167.05 312.7C162.933 315.517 155.892 316.925 145.925 316.925Z" fill="currentColor"/></svg>`;
|
|
8427
8466
|
function getToolbarAppPath() {
|
|
8428
8467
|
return new URL("./toolbar.js", import.meta.url).pathname;
|
|
8429
8468
|
}
|
package/dist/integration.js
CHANGED
|
@@ -353,7 +353,7 @@ var clientCss = "https://app.frontman.sh/frontman.css";
|
|
|
353
353
|
var devClientJs = "http://localhost:5173/src/Main.res.mjs";
|
|
354
354
|
|
|
355
355
|
// src/FrontmanAstro__Config.res.mjs
|
|
356
|
-
var packageVersion = "0.5.
|
|
356
|
+
var packageVersion = "0.5.2" ;
|
|
357
357
|
var host = process.env["FRONTMAN_HOST"];
|
|
358
358
|
var defaultHost = host !== void 0 ? host : apiHost;
|
|
359
359
|
var ensureConfig = (function(c2) {
|
|
@@ -2684,6 +2684,7 @@ var defaultConfig_stdoutPatterns = [
|
|
|
2684
2684
|
"hmr",
|
|
2685
2685
|
"error",
|
|
2686
2686
|
"Error",
|
|
2687
|
+
"ERROR",
|
|
2687
2688
|
"astro",
|
|
2688
2689
|
"build"
|
|
2689
2690
|
];
|
|
@@ -2831,12 +2832,16 @@ function handleStdoutWrite(state, message4) {
|
|
|
2831
2832
|
}
|
|
2832
2833
|
function interceptStdout(_state) {
|
|
2833
2834
|
(function(_state2) {
|
|
2834
|
-
const
|
|
2835
|
-
|
|
2836
|
-
|
|
2837
|
-
|
|
2838
|
-
|
|
2835
|
+
const interceptStream = (stream) => {
|
|
2836
|
+
const originalWrite = stream.write.bind(stream);
|
|
2837
|
+
stream.write = (chunk, ...args) => {
|
|
2838
|
+
const message4 = typeof chunk === "string" ? chunk : chunk.toString();
|
|
2839
|
+
handleStdoutWrite(_state2, message4);
|
|
2840
|
+
return originalWrite(chunk, ...args);
|
|
2841
|
+
};
|
|
2839
2842
|
};
|
|
2843
|
+
interceptStream(process.stdout);
|
|
2844
|
+
interceptStream(process.stderr);
|
|
2840
2845
|
})(_state);
|
|
2841
2846
|
}
|
|
2842
2847
|
function interceptUncaughtErrors(state) {
|
|
@@ -6122,11 +6127,13 @@ function generateHTML(config) {
|
|
|
6122
6127
|
let clientCssTag = mapOr(config.clientCssUrl, "", (url2) => `<link rel="stylesheet" href="` + url2 + `">`);
|
|
6123
6128
|
let entrypointTemplate = mapOr(config.entrypointUrl, "", (url2) => `<script type="template" id="frontman-entrypoint-url">` + url2 + `</script>`);
|
|
6124
6129
|
let themeClass = config.isLightTheme ? "" : "dark";
|
|
6125
|
-
let
|
|
6130
|
+
let getEnvKey = (varName) => flatMap(process.env[varName], (key) => {
|
|
6126
6131
|
if (key !== "") {
|
|
6127
6132
|
return key;
|
|
6128
6133
|
}
|
|
6129
6134
|
});
|
|
6135
|
+
let openrouterKey = getEnvKey("OPENROUTER_API_KEY");
|
|
6136
|
+
let anthropicKey = getEnvKey("ANTHROPIC_API_KEY");
|
|
6130
6137
|
let configObj = Object.fromEntries([
|
|
6131
6138
|
[
|
|
6132
6139
|
"framework",
|
|
@@ -6148,6 +6155,9 @@ function generateHTML(config) {
|
|
|
6148
6155
|
forEach(openrouterKey, (key) => {
|
|
6149
6156
|
configObj["openrouterKeyValue"] = key;
|
|
6150
6157
|
});
|
|
6158
|
+
forEach(anthropicKey, (key) => {
|
|
6159
|
+
configObj["anthropicKeyValue"] = key;
|
|
6160
|
+
});
|
|
6151
6161
|
let payload = JSON.stringify(configObj);
|
|
6152
6162
|
let runtimeConfigScript = `<script>window.__frontmanRuntime=` + payload + `</script>`;
|
|
6153
6163
|
return `<!DOCTYPE html>
|
|
@@ -7814,6 +7824,13 @@ async function Te(o) {
|
|
|
7814
7824
|
}
|
|
7815
7825
|
}
|
|
7816
7826
|
|
|
7827
|
+
// ../frontman-protocol/src/FrontmanProtocol__Types.res.mjs
|
|
7828
|
+
enableJson2();
|
|
7829
|
+
var modelSelectionSchema = schema2((s2) => ({
|
|
7830
|
+
provider: s2.m(string2),
|
|
7831
|
+
value: s2.m(string2)
|
|
7832
|
+
}));
|
|
7833
|
+
|
|
7817
7834
|
// ../frontman-protocol/src/FrontmanProtocol__MCP.res.mjs
|
|
7818
7835
|
enableJson2();
|
|
7819
7836
|
var capabilitiesSchema = schema2((s2) => ({
|
|
@@ -7840,17 +7857,32 @@ schema2((s2) => ({
|
|
|
7840
7857
|
name: s2.m(string2),
|
|
7841
7858
|
arguments: s2.m(option2(dict2(json2)))
|
|
7842
7859
|
}));
|
|
7860
|
+
var toolResultContentTypeSchema = union2([
|
|
7861
|
+
literal2("text"),
|
|
7862
|
+
literal2("image"),
|
|
7863
|
+
literal2("resource")
|
|
7864
|
+
]);
|
|
7843
7865
|
var toolResultContentSchema = schema2((s2) => ({
|
|
7844
|
-
type: s2.m(
|
|
7866
|
+
type: s2.m(toolResultContentTypeSchema),
|
|
7845
7867
|
text: s2.m(string2)
|
|
7846
7868
|
}));
|
|
7847
7869
|
schema2((s2) => ({
|
|
7848
7870
|
code: s2.m(int2),
|
|
7849
7871
|
message: s2.m(string2)
|
|
7850
7872
|
}));
|
|
7873
|
+
var callToolResultMetaSchema = schema2((s2) => ({
|
|
7874
|
+
model: s2.m(option2(modelSelectionSchema)),
|
|
7875
|
+
envApiKey: s2.m(dict2(string2))
|
|
7876
|
+
}));
|
|
7877
|
+
var emptyMeta_envApiKey = {};
|
|
7878
|
+
var emptyMeta = {
|
|
7879
|
+
model: void 0,
|
|
7880
|
+
envApiKey: emptyMeta_envApiKey
|
|
7881
|
+
};
|
|
7851
7882
|
var callToolResultSchema = schema2((s2) => ({
|
|
7852
7883
|
content: s2.m(array2(toolResultContentSchema)),
|
|
7853
|
-
isError: s2.m(option2(bool2))
|
|
7884
|
+
isError: s2.m(option2(bool2)),
|
|
7885
|
+
_meta: s2.m(callToolResultMetaSchema)
|
|
7854
7886
|
}));
|
|
7855
7887
|
schema2((s2) => ({
|
|
7856
7888
|
tools: s2.m(array2(json2))
|
|
@@ -7933,7 +7965,8 @@ async function executeTool(registry, ctx2, name15, $$arguments) {
|
|
|
7933
7965
|
type: "text",
|
|
7934
7966
|
text: result._0
|
|
7935
7967
|
}],
|
|
7936
|
-
isError: true
|
|
7968
|
+
isError: true,
|
|
7969
|
+
_meta: emptyMeta
|
|
7937
7970
|
}
|
|
7938
7971
|
};
|
|
7939
7972
|
}
|
|
@@ -7945,7 +7978,8 @@ async function executeTool(registry, ctx2, name15, $$arguments) {
|
|
|
7945
7978
|
type: "text",
|
|
7946
7979
|
text: JSON.stringify(outputJson)
|
|
7947
7980
|
}],
|
|
7948
|
-
isError: void 0
|
|
7981
|
+
isError: void 0,
|
|
7982
|
+
_meta: emptyMeta
|
|
7949
7983
|
}
|
|
7950
7984
|
};
|
|
7951
7985
|
} catch (raw_e) {
|
|
@@ -7973,7 +8007,8 @@ function resultToMCP(result) {
|
|
|
7973
8007
|
type: "text",
|
|
7974
8008
|
text: `Tool not found: ` + result._0
|
|
7975
8009
|
}],
|
|
7976
|
-
isError: true
|
|
8010
|
+
isError: true,
|
|
8011
|
+
_meta: emptyMeta
|
|
7977
8012
|
};
|
|
7978
8013
|
case "InvalidInput":
|
|
7979
8014
|
return {
|
|
@@ -7981,7 +8016,8 @@ function resultToMCP(result) {
|
|
|
7981
8016
|
type: "text",
|
|
7982
8017
|
text: `Invalid input: ` + result._0
|
|
7983
8018
|
}],
|
|
7984
|
-
isError: true
|
|
8019
|
+
isError: true,
|
|
8020
|
+
_meta: emptyMeta
|
|
7985
8021
|
};
|
|
7986
8022
|
case "ExecutionError":
|
|
7987
8023
|
return {
|
|
@@ -7989,7 +8025,8 @@ function resultToMCP(result) {
|
|
|
7989
8025
|
type: "text",
|
|
7990
8026
|
text: `Execution error: ` + result._0
|
|
7991
8027
|
}],
|
|
7992
|
-
isError: true
|
|
8028
|
+
isError: true,
|
|
8029
|
+
_meta: emptyMeta
|
|
7993
8030
|
};
|
|
7994
8031
|
}
|
|
7995
8032
|
}
|
|
@@ -8078,7 +8115,8 @@ async function handleToolCall(registry, config, req) {
|
|
|
8078
8115
|
let errorResult_isError2 = true;
|
|
8079
8116
|
let errorResult2 = {
|
|
8080
8117
|
content: errorResult_content2,
|
|
8081
|
-
isError: errorResult_isError2
|
|
8118
|
+
isError: errorResult_isError2,
|
|
8119
|
+
_meta: emptyMeta
|
|
8082
8120
|
};
|
|
8083
8121
|
controller.enqueue(encoder.encode(errorEvent(errorResult2)));
|
|
8084
8122
|
controller.close();
|
|
@@ -8097,7 +8135,8 @@ async function handleToolCall(registry, config, req) {
|
|
|
8097
8135
|
let errorResult_isError = true;
|
|
8098
8136
|
let errorResult = {
|
|
8099
8137
|
content: errorResult_content,
|
|
8100
|
-
isError: errorResult_isError
|
|
8138
|
+
isError: errorResult_isError,
|
|
8139
|
+
_meta: emptyMeta
|
|
8101
8140
|
};
|
|
8102
8141
|
let json3 = reverseConvertToJsonOrThrow2(errorResult, callToolResultSchema);
|
|
8103
8142
|
return Response.json(json3, {
|
|
@@ -8205,19 +8244,19 @@ function isFrontmanRoute(pathname, basePath, method) {
|
|
|
8205
8244
|
function getCanonicalRedirect(prefixPath, basePath) {
|
|
8206
8245
|
let suffix = "/" + basePath;
|
|
8207
8246
|
if (prefixPath === basePath) {
|
|
8208
|
-
return "/" + basePath;
|
|
8247
|
+
return "/" + basePath + "/";
|
|
8209
8248
|
}
|
|
8210
8249
|
if (prefixPath.endsWith(suffix)) {
|
|
8211
8250
|
let stripped = prefixPath.slice(0, prefixPath.length - suffix.length | 0);
|
|
8212
8251
|
let cleanPrefix = stripped === "" ? "" : stripped;
|
|
8213
|
-
let tmp = cleanPrefix === "" ? "/" + basePath : "/" + cleanPrefix + "/" + basePath;
|
|
8252
|
+
let tmp = cleanPrefix === "" ? "/" + basePath + "/" : "/" + cleanPrefix + "/" + basePath + "/";
|
|
8214
8253
|
return tmp;
|
|
8215
8254
|
}
|
|
8216
8255
|
if (!prefixPath.startsWith(basePath + "/")) {
|
|
8217
8256
|
return;
|
|
8218
8257
|
}
|
|
8219
|
-
let rest = prefixPath.slice(basePath.length + 1 | 0);
|
|
8220
|
-
let tmp$1 = rest === "" ? "/" + basePath : "/" + rest + "/" + basePath;
|
|
8258
|
+
let rest = prefixPath.slice(basePath.length + 1 | 0, prefixPath.length);
|
|
8259
|
+
let tmp$1 = rest === "" ? "/" + basePath + "/" : "/" + rest + "/" + basePath + "/";
|
|
8221
8260
|
return tmp$1;
|
|
8222
8261
|
}
|
|
8223
8262
|
function buildEntrypointUrl(config, requestUrl, prefixPath) {
|
|
@@ -8227,7 +8266,7 @@ function buildEntrypointUrl(config, requestUrl, prefixPath) {
|
|
|
8227
8266
|
}
|
|
8228
8267
|
let url2 = new URL(requestUrl);
|
|
8229
8268
|
let origin = url2.origin;
|
|
8230
|
-
let pagePath = prefixPath === "" ? "/" : "/" + prefixPath;
|
|
8269
|
+
let pagePath = prefixPath === "" ? "/" : "/" + prefixPath + "/";
|
|
8231
8270
|
return origin + pagePath;
|
|
8232
8271
|
}
|
|
8233
8272
|
function createMiddleware(config, registry) {
|
|
@@ -8426,7 +8465,7 @@ function frontmanPropsInjectionPlugin2(prim) {
|
|
|
8426
8465
|
return frontmanPropsInjectionPlugin();
|
|
8427
8466
|
}
|
|
8428
8467
|
var annotationCaptureScript2 = annotationCaptureScript;
|
|
8429
|
-
var icon = `<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="
|
|
8468
|
+
var icon = `<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="90 70 230 270" fill="none"><path d="M145.925 316.925C136.175 316.925 129.242 315.517 125.125 312.7C121.008 309.667 118.517 305.875 117.65 301.325C116.783 296.558 116.35 291.792 116.35 287.025V119C116.35 107.733 118.517 100.042 122.85 95.925C127.4 91.5917 135.417 89.425 146.9 89.425H265.85C270.833 89.425 275.492 89.8583 279.825 90.725C284.375 91.5917 288.058 94.0833 290.875 98.2C293.692 102.317 295.1 109.358 295.1 119.325C295.1 129.075 293.583 136.008 290.55 140.125C287.733 144.242 284.05 146.733 279.5 147.6C274.95 148.467 270.183 148.9 265.2 148.9H175.825V177.825H235.625C240.608 177.825 245.05 178.258 248.95 179.125C253.067 179.775 256.208 181.942 258.375 185.625C260.758 189.092 261.95 195.158 261.95 203.825C261.95 212.058 260.758 217.908 258.375 221.375C255.992 224.842 252.742 226.9 248.625 227.55C244.725 228.2 240.283 228.525 235.3 228.525H175.825V287.35C175.825 292.117 175.392 296.775 174.525 301.325C173.658 305.875 171.167 309.667 167.05 312.7C162.933 315.517 155.892 316.925 145.925 316.925Z" fill="currentColor"/></svg>`;
|
|
8430
8469
|
function getToolbarAppPath() {
|
|
8431
8470
|
return new URL("./toolbar.js", import.meta.url).pathname;
|
|
8432
8471
|
}
|
package/dist/toolbar.js
CHANGED
|
@@ -62,9 +62,10 @@ function app_init(_canvas, app2, _server) {
|
|
|
62
62
|
return;
|
|
63
63
|
}
|
|
64
64
|
let basePath = _getBasePath();
|
|
65
|
-
let
|
|
66
|
-
let
|
|
67
|
-
let
|
|
65
|
+
let rawPathname = location.pathname;
|
|
66
|
+
let pathname = rawPathname.endsWith("/") ? rawPathname : rawPathname + "/";
|
|
67
|
+
let alreadyInFrontman = pathname === `/` + basePath + `/` || pathname.endsWith(`/` + basePath + `/`);
|
|
68
|
+
let url = alreadyInFrontman ? pathname : pathname + basePath + `/`;
|
|
68
69
|
window.location.assign(url);
|
|
69
70
|
app2.toggleState({
|
|
70
71
|
state: false
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@frontman-ai/astro",
|
|
3
|
-
"version": "0.5.
|
|
3
|
+
"version": "0.5.2",
|
|
4
4
|
"description": "Astro integration for Frontman",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"author": "Frontman AI",
|
|
@@ -38,16 +38,11 @@
|
|
|
38
38
|
"./integration": "./dist/integration.js",
|
|
39
39
|
"./toolbar": "./dist/toolbar.js"
|
|
40
40
|
},
|
|
41
|
-
"files": [
|
|
42
|
-
"dist",
|
|
43
|
-
"index.d.ts",
|
|
44
|
-
"README.md"
|
|
45
|
-
],
|
|
41
|
+
"files": ["dist", "index.d.ts", "README.md"],
|
|
46
42
|
"scripts": {
|
|
47
43
|
"build:rescript": "rescript build",
|
|
48
44
|
"build:bundle": "tsup",
|
|
49
|
-
"build": "yarn build:rescript && yarn build:bundle"
|
|
50
|
-
"prepublishOnly": "yarn build"
|
|
45
|
+
"build": "yarn build:rescript && yarn build:bundle"
|
|
51
46
|
},
|
|
52
47
|
"engines": {
|
|
53
48
|
"node": ">=18.0.0"
|