maplibre-gl-geoagent 0.4.2 → 0.4.4
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/{GeoAgentControl-NjhimZRg.cjs → GeoAgentControl-BYfsQsUU.cjs} +161 -46
- package/dist/{GeoAgentControl-NjhimZRg.cjs.map → GeoAgentControl-BYfsQsUU.cjs.map} +1 -1
- package/dist/{GeoAgentControl-CM-lWHhd.js → GeoAgentControl-CNQpbA-X.js} +161 -46
- package/dist/{GeoAgentControl-CM-lWHhd.js.map → GeoAgentControl-CNQpbA-X.js.map} +1 -1
- package/dist/{anthropic-poATb89G.cjs → anthropic-0HkAVdzd.cjs} +2 -2
- package/dist/{anthropic-poATb89G.cjs.map → anthropic-0HkAVdzd.cjs.map} +1 -1
- package/dist/{anthropic-qn30x05g.js → anthropic-BwVcgri0.js} +2 -2
- package/dist/{anthropic-qn30x05g.js.map → anthropic-BwVcgri0.js.map} +1 -1
- package/dist/{browser-CRRVT6sN.js → browser-1SkgqVpl.js} +2 -2
- package/dist/{browser-CRRVT6sN.js.map → browser-1SkgqVpl.js.map} +1 -1
- package/dist/{browser-DfKdZvWC.cjs → browser-BtM59MC_.cjs} +2 -2
- package/dist/{browser-DfKdZvWC.cjs.map → browser-BtM59MC_.cjs.map} +1 -1
- package/dist/{index-nbt2E_lW.js → index-A1swYU5S.js} +2 -2
- package/dist/{index-nbt2E_lW.js.map → index-A1swYU5S.js.map} +1 -1
- package/dist/{index-DUXFjmo_.cjs → index-BNkHglHv.cjs} +2 -2
- package/dist/{index-DUXFjmo_.cjs.map → index-BNkHglHv.cjs.map} +1 -1
- package/dist/{index-BHJHkcUd.cjs → index-BoF3kFnA.cjs} +2 -2
- package/dist/{index-BHJHkcUd.cjs.map → index-BoF3kFnA.cjs.map} +1 -1
- package/dist/{index-D8NXbhES.cjs → index-D6NOZFBl.cjs} +2 -2
- package/dist/{index-D8NXbhES.cjs.map → index-D6NOZFBl.cjs.map} +1 -1
- package/dist/{index-DMcVy720.js → index-Dvgf4Wa_.js} +2 -2
- package/dist/{index-DMcVy720.js.map → index-Dvgf4Wa_.js.map} +1 -1
- package/dist/{index-CCdoSNb8.js → index-NrFXGjTQ.js} +2 -2
- package/dist/{index-CCdoSNb8.js.map → index-NrFXGjTQ.js.map} +1 -1
- package/dist/index.cjs +1 -1
- package/dist/index.mjs +1 -1
- package/dist/maplibre-gl-geoagent.css +51 -22
- package/dist/react.cjs +1 -1
- package/dist/react.mjs +1 -1
- package/dist/types/lib/core/GeoAgentControl.d.ts +20 -1
- package/dist/types/lib/core/GeoAgentControl.d.ts.map +1 -1
- package/dist/types/lib/core/types.d.ts +18 -0
- package/dist/types/lib/core/types.d.ts.map +1 -1
- package/package.json +1 -1
|
@@ -3519,7 +3519,7 @@ class HttpProtocol extends SerdeContext {
|
|
|
3519
3519
|
});
|
|
3520
3520
|
}
|
|
3521
3521
|
async loadEventStreamCapability() {
|
|
3522
|
-
const { EventStreamSerde } = await Promise.resolve().then(() => require("./index-
|
|
3522
|
+
const { EventStreamSerde } = await Promise.resolve().then(() => require("./index-BNkHglHv.cjs"));
|
|
3523
3523
|
return new EventStreamSerde({
|
|
3524
3524
|
marshaller: this.getEventStreamMarshaller(),
|
|
3525
3525
|
serializer: this.serializer,
|
|
@@ -42665,7 +42665,7 @@ class EarthEngineService {
|
|
|
42665
42665
|
}
|
|
42666
42666
|
async loadEe() {
|
|
42667
42667
|
if (!this.eePromise) {
|
|
42668
|
-
this.eePromise = Promise.resolve().then(() => require("./browser-
|
|
42668
|
+
this.eePromise = Promise.resolve().then(() => require("./browser-BtM59MC_.cjs")).then((n) => n.browser).then((module2) => {
|
|
42669
42669
|
const imported = "default" in module2 ? module2.default : module2;
|
|
42670
42670
|
const ee = imported;
|
|
42671
42671
|
const scope2 = globalThis;
|
|
@@ -45919,6 +45919,9 @@ ${code2}
|
|
|
45919
45919
|
}
|
|
45920
45920
|
const DEFAULT_PROVIDER = "openai-responses";
|
|
45921
45921
|
const DEFAULT_STORAGE_PREFIX = "geoagent.maplibre";
|
|
45922
|
+
const STATUS_READY = "Ready";
|
|
45923
|
+
const STATUS_SETUP = "Setup required";
|
|
45924
|
+
const IDLE_STATUS_LABELS = /* @__PURE__ */ new Set([STATUS_READY, STATUS_SETUP]);
|
|
45922
45925
|
const BASE_PROVIDER_CONFIGS = {
|
|
45923
45926
|
"openai-responses": {
|
|
45924
45927
|
id: "openai-responses",
|
|
@@ -46025,7 +46028,6 @@ class GeoAgentControl {
|
|
|
46025
46028
|
__publicField(this, "eventHandlers", new globalThis.Map());
|
|
46026
46029
|
__publicField(this, "resizeHandler", null);
|
|
46027
46030
|
__publicField(this, "mapResizeHandler", null);
|
|
46028
|
-
__publicField(this, "clickOutsideHandler", null);
|
|
46029
46031
|
__publicField(this, "panelResizeMoveHandler", null);
|
|
46030
46032
|
__publicField(this, "panelResizeUpHandler", null);
|
|
46031
46033
|
__publicField(this, "activeAbortController", null);
|
|
@@ -46037,6 +46039,9 @@ class GeoAgentControl {
|
|
|
46037
46039
|
panelWidth: options.panelWidth ?? 390,
|
|
46038
46040
|
panelMinWidth: options.panelMinWidth ?? 320,
|
|
46039
46041
|
panelMaxWidth: options.panelMaxWidth ?? 720,
|
|
46042
|
+
panelHeight: options.panelHeight,
|
|
46043
|
+
panelMinHeight: options.panelMinHeight ?? 320,
|
|
46044
|
+
panelMaxHeight: options.panelMaxHeight ?? 2e3,
|
|
46040
46045
|
className: options.className ?? "",
|
|
46041
46046
|
defaultProvider: options.defaultProvider ?? DEFAULT_PROVIDER,
|
|
46042
46047
|
storagePrefix: options.storagePrefix ?? DEFAULT_STORAGE_PREFIX,
|
|
@@ -46052,6 +46057,7 @@ class GeoAgentControl {
|
|
|
46052
46057
|
this.state = {
|
|
46053
46058
|
collapsed: this.options.collapsed,
|
|
46054
46059
|
panelWidth: this.constrainPanelWidth(this.options.panelWidth),
|
|
46060
|
+
panelHeight: this.options.panelHeight !== void 0 ? this.constrainPanelHeight(this.options.panelHeight) : void 0,
|
|
46055
46061
|
busy: false,
|
|
46056
46062
|
providerId,
|
|
46057
46063
|
modelId: this.initialModelId(providerId),
|
|
@@ -46080,8 +46086,8 @@ class GeoAgentControl {
|
|
|
46080
46086
|
});
|
|
46081
46087
|
this.setupEventListeners();
|
|
46082
46088
|
this.loadProviderSettings();
|
|
46083
|
-
this.
|
|
46084
|
-
this.appendLog("system",
|
|
46089
|
+
this.applyIdleStatus(true);
|
|
46090
|
+
this.appendLog("system", this.readyLogMessage());
|
|
46085
46091
|
this.updateControls();
|
|
46086
46092
|
if (!this.state.collapsed) {
|
|
46087
46093
|
this.panel.classList.add("expanded");
|
|
@@ -46099,10 +46105,6 @@ class GeoAgentControl {
|
|
|
46099
46105
|
this.map.off("resize", this.mapResizeHandler);
|
|
46100
46106
|
this.mapResizeHandler = null;
|
|
46101
46107
|
}
|
|
46102
|
-
if (this.clickOutsideHandler) {
|
|
46103
|
-
document.removeEventListener("click", this.clickOutsideHandler);
|
|
46104
|
-
this.clickOutsideHandler = null;
|
|
46105
|
-
}
|
|
46106
46108
|
this.stopPanelResize();
|
|
46107
46109
|
(_a3 = this.activeAbortController) == null ? void 0 : _a3.abort();
|
|
46108
46110
|
(_b3 = this.agent) == null ? void 0 : _b3.cancel();
|
|
@@ -46142,6 +46144,11 @@ class GeoAgentControl {
|
|
|
46142
46144
|
this.state.panelWidth = panelWidth;
|
|
46143
46145
|
this.panel.style.width = `${panelWidth}px`;
|
|
46144
46146
|
}
|
|
46147
|
+
if (newState.panelHeight !== void 0 && this.panel) {
|
|
46148
|
+
const panelHeight = this.constrainPanelHeight(newState.panelHeight);
|
|
46149
|
+
this.state.panelHeight = panelHeight;
|
|
46150
|
+
this.panel.style.height = `${panelHeight}px`;
|
|
46151
|
+
}
|
|
46145
46152
|
if (collapsedChanged) {
|
|
46146
46153
|
if (this.state.collapsed) {
|
|
46147
46154
|
(_a3 = this.panel) == null ? void 0 : _a3.classList.remove("expanded");
|
|
@@ -46267,6 +46274,9 @@ class GeoAgentControl {
|
|
|
46267
46274
|
const panel = document.createElement("div");
|
|
46268
46275
|
panel.className = "geoagent-panel";
|
|
46269
46276
|
panel.style.width = `${this.state.panelWidth}px`;
|
|
46277
|
+
if (this.state.panelHeight !== void 0) {
|
|
46278
|
+
panel.style.height = `${this.state.panelHeight}px`;
|
|
46279
|
+
}
|
|
46270
46280
|
const header = document.createElement("div");
|
|
46271
46281
|
header.className = "geoagent-panel-header";
|
|
46272
46282
|
const title2 = document.createElement("span");
|
|
@@ -46280,11 +46290,12 @@ class GeoAgentControl {
|
|
|
46280
46290
|
const closeButton = document.createElement("button");
|
|
46281
46291
|
closeButton.className = "geoagent-icon-button";
|
|
46282
46292
|
closeButton.type = "button";
|
|
46283
|
-
closeButton.title = "
|
|
46284
|
-
closeButton.setAttribute("aria-label", "
|
|
46293
|
+
closeButton.title = "Close";
|
|
46294
|
+
closeButton.setAttribute("aria-label", "Close");
|
|
46285
46295
|
closeButton.innerHTML = `
|
|
46286
46296
|
<svg viewBox="0 0 24 24" fill="none" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true">
|
|
46287
|
-
<path d="
|
|
46297
|
+
<path d="M18 6 6 18"></path>
|
|
46298
|
+
<path d="m6 6 12 12"></path>
|
|
46288
46299
|
</svg>
|
|
46289
46300
|
`;
|
|
46290
46301
|
closeButton.addEventListener("click", () => this.collapse());
|
|
@@ -46350,13 +46361,9 @@ class GeoAgentControl {
|
|
|
46350
46361
|
</div>
|
|
46351
46362
|
</form>
|
|
46352
46363
|
`;
|
|
46353
|
-
const
|
|
46354
|
-
|
|
46355
|
-
|
|
46356
|
-
resizeHandle.setAttribute("aria-orientation", "vertical");
|
|
46357
|
-
resizeHandle.setAttribute("aria-label", "Resize GeoAgent panel");
|
|
46358
|
-
resizeHandle.addEventListener("mousedown", (event) => this.startPanelResize(event));
|
|
46359
|
-
panel.append(header, content, resizeHandle);
|
|
46364
|
+
const resizeHandleLeft = this.createResizeHandle("bottom-left");
|
|
46365
|
+
const resizeHandleRight = this.createResizeHandle("bottom-right");
|
|
46366
|
+
panel.append(header, content, resizeHandleLeft, resizeHandleRight);
|
|
46360
46367
|
this.ui = {
|
|
46361
46368
|
status,
|
|
46362
46369
|
providerSelect: this.requiredElement(content, ".geoagent-provider"),
|
|
@@ -46379,7 +46386,8 @@ class GeoAgentControl {
|
|
|
46379
46386
|
cancelButton: this.requiredElement(content, ".geoagent-cancel"),
|
|
46380
46387
|
clearButton: this.requiredElement(content, ".geoagent-clear"),
|
|
46381
46388
|
copyButton: this.requiredElement(content, ".geoagent-copy"),
|
|
46382
|
-
|
|
46389
|
+
resizeHandleLeft,
|
|
46390
|
+
resizeHandleRight,
|
|
46383
46391
|
closeButton
|
|
46384
46392
|
};
|
|
46385
46393
|
this.ui.permissionRow.hidden = !this.options.showPermissionToggles;
|
|
@@ -46576,13 +46584,6 @@ class GeoAgentControl {
|
|
|
46576
46584
|
}
|
|
46577
46585
|
setupEventListeners() {
|
|
46578
46586
|
var _a3;
|
|
46579
|
-
this.clickOutsideHandler = (event) => {
|
|
46580
|
-
const target = event.target;
|
|
46581
|
-
if (this.container && this.panel && !this.container.contains(target) && !this.panel.contains(target)) {
|
|
46582
|
-
this.collapse();
|
|
46583
|
-
}
|
|
46584
|
-
};
|
|
46585
|
-
document.addEventListener("click", this.clickOutsideHandler);
|
|
46586
46587
|
this.resizeHandler = () => {
|
|
46587
46588
|
if (!this.state.collapsed) {
|
|
46588
46589
|
this.updatePanelPosition();
|
|
@@ -46655,23 +46656,67 @@ class GeoAgentControl {
|
|
|
46655
46656
|
Math.min(this.options.panelMaxWidth, Math.round(width))
|
|
46656
46657
|
);
|
|
46657
46658
|
}
|
|
46658
|
-
|
|
46659
|
-
|
|
46659
|
+
constrainPanelHeight(height) {
|
|
46660
|
+
var _a3;
|
|
46661
|
+
let max = this.options.panelMaxHeight;
|
|
46662
|
+
const mapHeight = ((_a3 = this.mapContainer) == null ? void 0 : _a3.clientHeight) ?? 0;
|
|
46663
|
+
if (mapHeight > 0) {
|
|
46664
|
+
max = Math.min(max, mapHeight - 20);
|
|
46665
|
+
}
|
|
46666
|
+
return Math.max(
|
|
46667
|
+
this.options.panelMinHeight,
|
|
46668
|
+
Math.min(max, Math.round(height))
|
|
46669
|
+
);
|
|
46670
|
+
}
|
|
46671
|
+
createResizeHandle(corner) {
|
|
46672
|
+
const handle = document.createElement("div");
|
|
46673
|
+
const side = corner === "bottom-left" ? "bl" : "br";
|
|
46674
|
+
handle.className = `geoagent-panel-resize-handle geoagent-panel-resize-handle-${side}`;
|
|
46675
|
+
handle.setAttribute("role", "separator");
|
|
46676
|
+
handle.setAttribute("aria-label", "Resize GeoAgent panel");
|
|
46677
|
+
handle.addEventListener("mousedown", (event) => this.startPanelResize(event, corner));
|
|
46678
|
+
return handle;
|
|
46679
|
+
}
|
|
46680
|
+
startPanelResize(event, corner) {
|
|
46681
|
+
if (!this.panel || !this.mapContainer) {
|
|
46660
46682
|
return;
|
|
46661
46683
|
}
|
|
46662
46684
|
event.preventDefault();
|
|
46663
46685
|
event.stopPropagation();
|
|
46664
|
-
const position = this.getControlPosition();
|
|
46665
|
-
const resizeDirection = position === "top-left" || position === "bottom-left" ? 1 : -1;
|
|
46666
|
-
const startX = event.clientX;
|
|
46667
|
-
const startWidth = this.panel.getBoundingClientRect().width || this.state.panelWidth;
|
|
46668
46686
|
this.stopPanelResize();
|
|
46687
|
+
const panelRect = this.panel.getBoundingClientRect();
|
|
46688
|
+
const mapRect = this.mapContainer.getBoundingClientRect();
|
|
46689
|
+
this.panel.style.top = `${panelRect.top - mapRect.top}px`;
|
|
46690
|
+
this.panel.style.bottom = "";
|
|
46691
|
+
if (corner === "bottom-left") {
|
|
46692
|
+
this.panel.style.right = `${mapRect.right - panelRect.right}px`;
|
|
46693
|
+
this.panel.style.left = "";
|
|
46694
|
+
} else {
|
|
46695
|
+
this.panel.style.left = `${panelRect.left - mapRect.left}px`;
|
|
46696
|
+
this.panel.style.right = "";
|
|
46697
|
+
}
|
|
46698
|
+
const startX = event.clientX;
|
|
46699
|
+
const startY = event.clientY;
|
|
46700
|
+
const startWidth = panelRect.width || this.state.panelWidth;
|
|
46701
|
+
const startHeight = panelRect.height || this.state.panelHeight || this.options.panelMinHeight;
|
|
46702
|
+
const widthDirection = corner === "bottom-left" ? -1 : 1;
|
|
46703
|
+
const gap = 8;
|
|
46704
|
+
const hasLayout = mapRect.width > 0 && mapRect.height > 0;
|
|
46705
|
+
const maxWidth = !hasLayout ? Number.POSITIVE_INFINITY : corner === "bottom-left" ? panelRect.right - mapRect.left - gap : mapRect.right - panelRect.left - gap;
|
|
46706
|
+
const maxHeight = !hasLayout ? Number.POSITIVE_INFINITY : mapRect.bottom - panelRect.top - gap;
|
|
46669
46707
|
this.panel.classList.add("resizing");
|
|
46670
46708
|
document.body.classList.add("geoagent-panel-resizing");
|
|
46671
46709
|
this.panelResizeMoveHandler = (moveEvent) => {
|
|
46672
46710
|
moveEvent.preventDefault();
|
|
46673
|
-
const
|
|
46674
|
-
|
|
46711
|
+
const width = Math.min(
|
|
46712
|
+
maxWidth,
|
|
46713
|
+
startWidth + (moveEvent.clientX - startX) * widthDirection
|
|
46714
|
+
);
|
|
46715
|
+
const height = Math.min(
|
|
46716
|
+
maxHeight,
|
|
46717
|
+
startHeight + (moveEvent.clientY - startY)
|
|
46718
|
+
);
|
|
46719
|
+
this.setState({ panelWidth: width, panelHeight: height });
|
|
46675
46720
|
};
|
|
46676
46721
|
this.panelResizeUpHandler = () => this.stopPanelResize();
|
|
46677
46722
|
document.addEventListener("mousemove", this.panelResizeMoveHandler);
|
|
@@ -46702,7 +46747,6 @@ class GeoAgentControl {
|
|
|
46702
46747
|
this.ui.bedrockRegionLabel.hidden = this.state.providerId !== "bedrock";
|
|
46703
46748
|
this.ui.allowCodeInput.checked = this.state.allowCodeExecution;
|
|
46704
46749
|
this.ui.allowDestructiveInput.checked = this.state.allowDestructiveTools;
|
|
46705
|
-
this.ui.closeButton.setAttribute("aria-expanded", String(!this.state.collapsed));
|
|
46706
46750
|
}
|
|
46707
46751
|
currentProviderId() {
|
|
46708
46752
|
var _a3;
|
|
@@ -46740,6 +46784,68 @@ class GeoAgentControl {
|
|
|
46740
46784
|
this.ui.status.textContent = text2;
|
|
46741
46785
|
this.ui.status.className = `geoagent-status ${kind}`.trim();
|
|
46742
46786
|
}
|
|
46787
|
+
/**
|
|
46788
|
+
* Whether the agent has everything it needs to run a prompt for the current
|
|
46789
|
+
* provider: an API key, a model id, and (for Bedrock) a region.
|
|
46790
|
+
*/
|
|
46791
|
+
isConfigured() {
|
|
46792
|
+
if (!this.ui) {
|
|
46793
|
+
return false;
|
|
46794
|
+
}
|
|
46795
|
+
if (!this.ui.apiKeyInput.value.trim() || !this.ui.modelIdInput.value.trim()) {
|
|
46796
|
+
return false;
|
|
46797
|
+
}
|
|
46798
|
+
if (this.state.providerId === "bedrock" && !this.ui.bedrockRegionInput.value.trim()) {
|
|
46799
|
+
return false;
|
|
46800
|
+
}
|
|
46801
|
+
return true;
|
|
46802
|
+
}
|
|
46803
|
+
/**
|
|
46804
|
+
* Human-readable, comma-separated list of the configuration fields that are
|
|
46805
|
+
* still missing for the current provider (empty when fully configured).
|
|
46806
|
+
*/
|
|
46807
|
+
missingConfigSummary() {
|
|
46808
|
+
if (!this.ui) {
|
|
46809
|
+
return "";
|
|
46810
|
+
}
|
|
46811
|
+
const missing = [];
|
|
46812
|
+
if (!this.ui.apiKeyInput.value.trim()) {
|
|
46813
|
+
missing.push(this.currentProviderConfig().keyLabel);
|
|
46814
|
+
}
|
|
46815
|
+
if (!this.ui.modelIdInput.value.trim()) {
|
|
46816
|
+
missing.push("model");
|
|
46817
|
+
}
|
|
46818
|
+
if (this.state.providerId === "bedrock" && !this.ui.bedrockRegionInput.value.trim()) {
|
|
46819
|
+
missing.push("region");
|
|
46820
|
+
}
|
|
46821
|
+
return missing.join(", ");
|
|
46822
|
+
}
|
|
46823
|
+
readyLogMessage() {
|
|
46824
|
+
if (this.isConfigured()) {
|
|
46825
|
+
return "Browser-only Strands MapLibre agent ready.";
|
|
46826
|
+
}
|
|
46827
|
+
const missing = this.missingConfigSummary();
|
|
46828
|
+
return missing ? `Browser-only Strands MapLibre agent loaded. Add your ${missing} to start.` : "Browser-only Strands MapLibre agent loaded.";
|
|
46829
|
+
}
|
|
46830
|
+
/**
|
|
46831
|
+
* Refresh the idle status badge so it reflects whether the agent has the
|
|
46832
|
+
* credentials it needs. Transient run statuses (Running, Cancelled, Error,
|
|
46833
|
+
* Copied) are left untouched unless `force` is set, so this can be called
|
|
46834
|
+
* from updateControls() on every keystroke without clobbering them.
|
|
46835
|
+
*/
|
|
46836
|
+
applyIdleStatus(force = false) {
|
|
46837
|
+
if (!this.ui || this.state.busy && !force) {
|
|
46838
|
+
return;
|
|
46839
|
+
}
|
|
46840
|
+
if (!force && !IDLE_STATUS_LABELS.has(this.ui.status.textContent ?? "")) {
|
|
46841
|
+
return;
|
|
46842
|
+
}
|
|
46843
|
+
if (this.isConfigured()) {
|
|
46844
|
+
this.setStatus(STATUS_READY, "connected");
|
|
46845
|
+
} else {
|
|
46846
|
+
this.setStatus(STATUS_SETUP, "setup");
|
|
46847
|
+
}
|
|
46848
|
+
}
|
|
46743
46849
|
appendLog(role, text2, markdown = text2) {
|
|
46744
46850
|
if (!this.ui) {
|
|
46745
46851
|
throw new Error("GeoAgent control UI is not mounted.");
|
|
@@ -46816,16 +46922,24 @@ ${markdown.trim()}`;
|
|
|
46816
46922
|
textarea.remove();
|
|
46817
46923
|
}
|
|
46818
46924
|
this.setStatus("Copied", "connected");
|
|
46819
|
-
window.setTimeout(() => this.
|
|
46925
|
+
window.setTimeout(() => this.applyIdleStatus(true), 1200);
|
|
46820
46926
|
}
|
|
46821
46927
|
updateControls() {
|
|
46822
46928
|
if (!this.ui) {
|
|
46823
46929
|
return;
|
|
46824
46930
|
}
|
|
46825
|
-
|
|
46931
|
+
const configured = this.isConfigured();
|
|
46932
|
+
this.ui.sendButton.disabled = this.state.busy || !this.ui.prompt.value.trim() || !configured;
|
|
46933
|
+
if (configured) {
|
|
46934
|
+
this.ui.sendButton.removeAttribute("title");
|
|
46935
|
+
} else {
|
|
46936
|
+
const missing = this.missingConfigSummary();
|
|
46937
|
+
this.ui.sendButton.title = missing ? `Add your ${missing} to send a prompt.` : "Configuration required to send a prompt.";
|
|
46938
|
+
}
|
|
46826
46939
|
this.ui.cancelButton.disabled = !this.state.busy || this.cancelRequested;
|
|
46827
46940
|
this.ui.clearButton.disabled = this.state.busy;
|
|
46828
46941
|
this.ui.copyButton.disabled = this.ui.log.childElementCount === 0;
|
|
46942
|
+
this.applyIdleStatus();
|
|
46829
46943
|
}
|
|
46830
46944
|
invalidateAgent() {
|
|
46831
46945
|
this.agent = null;
|
|
@@ -46845,7 +46959,7 @@ ${markdown.trim()}`;
|
|
|
46845
46959
|
}
|
|
46846
46960
|
async createProviderModel(providerId, modelId, apiKey, bedrockRegion) {
|
|
46847
46961
|
if (providerId === "openai-responses" || providerId === "openai-chat") {
|
|
46848
|
-
const { OpenAIModel } = await Promise.resolve().then(() => require("./index-
|
|
46962
|
+
const { OpenAIModel } = await Promise.resolve().then(() => require("./index-BoF3kFnA.cjs"));
|
|
46849
46963
|
return new OpenAIModel({
|
|
46850
46964
|
api: providerId === "openai-responses" ? "responses" : "chat",
|
|
46851
46965
|
modelId,
|
|
@@ -46856,7 +46970,7 @@ ${markdown.trim()}`;
|
|
|
46856
46970
|
});
|
|
46857
46971
|
}
|
|
46858
46972
|
if (providerId === "anthropic") {
|
|
46859
|
-
const { AnthropicModel } = await Promise.resolve().then(() => require("./anthropic-
|
|
46973
|
+
const { AnthropicModel } = await Promise.resolve().then(() => require("./anthropic-0HkAVdzd.cjs"));
|
|
46860
46974
|
return new AnthropicModel({
|
|
46861
46975
|
modelId,
|
|
46862
46976
|
apiKey,
|
|
@@ -46866,7 +46980,7 @@ ${markdown.trim()}`;
|
|
|
46866
46980
|
});
|
|
46867
46981
|
}
|
|
46868
46982
|
if (providerId === "google") {
|
|
46869
|
-
const { GoogleModel } = await Promise.resolve().then(() => require("./index-
|
|
46983
|
+
const { GoogleModel } = await Promise.resolve().then(() => require("./index-D6NOZFBl.cjs"));
|
|
46870
46984
|
return new GoogleModel({
|
|
46871
46985
|
modelId,
|
|
46872
46986
|
apiKey
|
|
@@ -46992,7 +47106,11 @@ ${BROWSER_MAPLIBRE_CODE_SYSTEM_PROMPT}` : BROWSER_MAPLIBRE_SYSTEM_PROMPT;
|
|
|
46992
47106
|
} else {
|
|
46993
47107
|
this.appendAssistantLog(answer);
|
|
46994
47108
|
}
|
|
46995
|
-
|
|
47109
|
+
if (abortController.signal.aborted) {
|
|
47110
|
+
this.setStatus("Cancelled", "connected");
|
|
47111
|
+
} else {
|
|
47112
|
+
this.applyIdleStatus(true);
|
|
47113
|
+
}
|
|
46996
47114
|
} catch (error) {
|
|
46997
47115
|
const message = error instanceof Error ? error.message : String(error);
|
|
46998
47116
|
if (abortController.signal.aborted) {
|
|
@@ -47031,7 +47149,6 @@ ${BROWSER_MAPLIBRE_CODE_SYSTEM_PROMPT}` : BROWSER_MAPLIBRE_SYSTEM_PROMPT;
|
|
|
47031
47149
|
const buttonRect = button.getBoundingClientRect();
|
|
47032
47150
|
const mapRect = this.mapContainer.getBoundingClientRect();
|
|
47033
47151
|
const position = this.getControlPosition();
|
|
47034
|
-
const resizeOnLeft = position === "top-right" || position === "bottom-right";
|
|
47035
47152
|
const buttonTop = buttonRect.top - mapRect.top;
|
|
47036
47153
|
const buttonBottom = mapRect.bottom - buttonRect.bottom;
|
|
47037
47154
|
const buttonLeft = buttonRect.left - mapRect.left;
|
|
@@ -47041,8 +47158,6 @@ ${BROWSER_MAPLIBRE_CODE_SYSTEM_PROMPT}` : BROWSER_MAPLIBRE_SYSTEM_PROMPT;
|
|
|
47041
47158
|
this.panel.style.bottom = "";
|
|
47042
47159
|
this.panel.style.left = "";
|
|
47043
47160
|
this.panel.style.right = "";
|
|
47044
|
-
this.panel.classList.toggle("resize-left", resizeOnLeft);
|
|
47045
|
-
this.panel.classList.toggle("resize-right", !resizeOnLeft);
|
|
47046
47161
|
switch (position) {
|
|
47047
47162
|
case "top-left":
|
|
47048
47163
|
this.panel.style.top = `${buttonTop + buttonRect.height + panelGap}px`;
|
|
@@ -47089,4 +47204,4 @@ exports.toJsonValue = toJsonValue;
|
|
|
47089
47204
|
exports.toMimeType = toMimeType;
|
|
47090
47205
|
exports.toUtf8 = toUtf8;
|
|
47091
47206
|
exports.warnOnce = warnOnce;
|
|
47092
|
-
//# sourceMappingURL=GeoAgentControl-
|
|
47207
|
+
//# sourceMappingURL=GeoAgentControl-BYfsQsUU.cjs.map
|