maplibre-gl-geoagent 0.1.0 → 0.2.0

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.
Files changed (27) hide show
  1. package/README.md +21 -16
  2. package/dist/{GeoAgentControl-c10MBYNG.js → GeoAgentControl-C-3MIQTc.js} +17 -6
  3. package/dist/{GeoAgentControl-c10MBYNG.js.map → GeoAgentControl-C-3MIQTc.js.map} +1 -1
  4. package/dist/{GeoAgentControl-CmfTQTkJ.cjs → GeoAgentControl-CKY24iWC.cjs} +17 -6
  5. package/dist/{GeoAgentControl-CmfTQTkJ.cjs.map → GeoAgentControl-CKY24iWC.cjs.map} +1 -1
  6. package/dist/{anthropic-C7kTy6A0.js → anthropic-38gbSx-8.js} +2 -2
  7. package/dist/{anthropic-C7kTy6A0.js.map → anthropic-38gbSx-8.js.map} +1 -1
  8. package/dist/{anthropic-Y4byflsD.cjs → anthropic-M2EJ1iaX.cjs} +2 -2
  9. package/dist/{anthropic-Y4byflsD.cjs.map → anthropic-M2EJ1iaX.cjs.map} +1 -1
  10. package/dist/{index-m-aZEiVB.cjs → index-3mfmhCHC.cjs} +2 -2
  11. package/dist/{index-m-aZEiVB.cjs.map → index-3mfmhCHC.cjs.map} +1 -1
  12. package/dist/{index-DC2fUaFo.cjs → index-BUTngzVS.cjs} +2 -2
  13. package/dist/{index-DC2fUaFo.cjs.map → index-BUTngzVS.cjs.map} +1 -1
  14. package/dist/{index-CzhifCGI.cjs → index-Bc5JtMfe.cjs} +2 -2
  15. package/dist/{index-CzhifCGI.cjs.map → index-Bc5JtMfe.cjs.map} +1 -1
  16. package/dist/{index-Dta4g9Ff.js → index-DI9BALDH.js} +2 -2
  17. package/dist/{index-Dta4g9Ff.js.map → index-DI9BALDH.js.map} +1 -1
  18. package/dist/{index-DRJ1yR1n.js → index-DW6rmZdc.js} +2 -2
  19. package/dist/{index-DRJ1yR1n.js.map → index-DW6rmZdc.js.map} +1 -1
  20. package/dist/{index-CX7FTecz.js → index-DtsWabeI.js} +2 -2
  21. package/dist/{index-CX7FTecz.js.map → index-DtsWabeI.js.map} +1 -1
  22. package/dist/index.cjs +1 -1
  23. package/dist/index.mjs +1 -1
  24. package/dist/react.cjs +1 -1
  25. package/dist/react.mjs +1 -1
  26. package/dist/types/lib/core/GeoAgentControl.d.ts.map +1 -1
  27. package/package.json +1 -1
package/README.md CHANGED
@@ -4,6 +4,11 @@ A browser-only GeoAgent control for MapLibre GL JS. The control implements
4
4
  MapLibre's `IControl` interface and embeds a Strands TypeScript agent that can
5
5
  inspect and operate on the live map through dedicated browser tools.
6
6
 
7
+ [![npm version](https://img.shields.io/npm/v/maplibre-gl-geoagent.svg)](https://www.npmjs.com/package/maplibre-gl-geoagent)
8
+ [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
9
+ [![Open in CodeSandbox](https://img.shields.io/badge/Open%20in-CodeSandbox-blue?logo=codesandbox)](https://codesandbox.io/p/github/opengeos/maplibre-gl-geoagent)
10
+ [![Open in StackBlitz](https://img.shields.io/badge/Open%20in-StackBlitz-blue?logo=stackblitz)](https://stackblitz.com/github/opengeos/maplibre-gl-geoagent)
11
+
7
12
  ## Features
8
13
 
9
14
  - Collapsible MapLibre control with a floating chat panel
@@ -113,22 +118,22 @@ Converse model ID, and set the AWS region. The default Bedrock model is
113
118
 
114
119
  ## Options
115
120
 
116
- | Option | Type | Default |
117
- | --- | --- | --- |
118
- | `collapsed` | `boolean` | `true` |
119
- | `position` | `'top-left' \| 'top-right' \| 'bottom-left' \| 'bottom-right'` | `'top-right'` |
120
- | `title` | `string` | `'GeoAgent'` |
121
- | `panelWidth` | `number` | `390` |
122
- | `panelMinWidth` | `number` | `320` |
123
- | `panelMaxWidth` | `number` | `720` |
124
- | `className` | `string` | `''` |
125
- | `defaultProvider` | `GeoAgentProviderId` | `'openai-responses'` |
126
- | `defaultModel` | `string \| Partial<Record<GeoAgentProviderId, string>>` | provider default |
127
- | `storagePrefix` | `string` | `'geoagent.maplibre'` |
128
- | `allowCodeExecutionDefault` | `boolean` | `true` |
129
- | `allowDestructiveToolsDefault` | `boolean` | `true` |
130
- | `showPermissionToggles` | `boolean` | `false` |
131
- | `basemaps` | `Record<string, string \| StyleSpecification>` | built-in basemaps |
121
+ | Option | Type | Default |
122
+ | ------------------------------ | -------------------------------------------------------------- | --------------------- |
123
+ | `collapsed` | `boolean` | `true` |
124
+ | `position` | `'top-left' \| 'top-right' \| 'bottom-left' \| 'bottom-right'` | `'top-right'` |
125
+ | `title` | `string` | `'GeoAgent'` |
126
+ | `panelWidth` | `number` | `390` |
127
+ | `panelMinWidth` | `number` | `320` |
128
+ | `panelMaxWidth` | `number` | `720` |
129
+ | `className` | `string` | `''` |
130
+ | `defaultProvider` | `GeoAgentProviderId` | `'openai-responses'` |
131
+ | `defaultModel` | `string \| Partial<Record<GeoAgentProviderId, string>>` | provider default |
132
+ | `storagePrefix` | `string` | `'geoagent.maplibre'` |
133
+ | `allowCodeExecutionDefault` | `boolean` | `true` |
134
+ | `allowDestructiveToolsDefault` | `boolean` | `true` |
135
+ | `showPermissionToggles` | `boolean` | `false` |
136
+ | `basemaps` | `Record<string, string \| StyleSpecification>` | built-in basemaps |
132
137
 
133
138
  ## Browser Credentials
134
139
 
@@ -3518,7 +3518,7 @@ class HttpProtocol extends SerdeContext {
3518
3518
  });
3519
3519
  }
3520
3520
  async loadEventStreamCapability() {
3521
- const { EventStreamSerde } = await import("./index-Dta4g9Ff.js");
3521
+ const { EventStreamSerde } = await import("./index-DI9BALDH.js");
3522
3522
  return new EventStreamSerde({
3523
3523
  marshaller: this.getEventStreamMarshaller(),
3524
3524
  serializer: this.serializer,
@@ -47169,7 +47169,18 @@ class GeoAgentControl {
47169
47169
  });
47170
47170
  ui.prompt.addEventListener("input", () => this.updateControls());
47171
47171
  ui.prompt.addEventListener("keydown", (event) => {
47172
- if (event.key === "Enter" && (event.ctrlKey || event.metaKey)) {
47172
+ if (event.key === "Enter" && event.ctrlKey && !event.isComposing) {
47173
+ event.preventDefault();
47174
+ ui.prompt.setRangeText(
47175
+ "\n",
47176
+ ui.prompt.selectionStart,
47177
+ ui.prompt.selectionEnd,
47178
+ "end"
47179
+ );
47180
+ ui.prompt.dispatchEvent(new Event("input", { bubbles: true }));
47181
+ return;
47182
+ }
47183
+ if (event.key === "Enter" && !event.ctrlKey && !event.metaKey && !event.shiftKey && !event.altKey && !event.isComposing) {
47173
47184
  event.preventDefault();
47174
47185
  void this.sendPrompt();
47175
47186
  return;
@@ -47447,7 +47458,7 @@ ${markdown.trim()}`;
47447
47458
  }
47448
47459
  async createProviderModel(providerId, modelId, apiKey, bedrockRegion) {
47449
47460
  if (providerId === "openai-responses" || providerId === "openai-chat") {
47450
- const { OpenAIModel } = await import("./index-DRJ1yR1n.js");
47461
+ const { OpenAIModel } = await import("./index-DW6rmZdc.js");
47451
47462
  return new OpenAIModel({
47452
47463
  api: providerId === "openai-responses" ? "responses" : "chat",
47453
47464
  modelId,
@@ -47458,7 +47469,7 @@ ${markdown.trim()}`;
47458
47469
  });
47459
47470
  }
47460
47471
  if (providerId === "anthropic") {
47461
- const { AnthropicModel } = await import("./anthropic-C7kTy6A0.js");
47472
+ const { AnthropicModel } = await import("./anthropic-38gbSx-8.js");
47462
47473
  return new AnthropicModel({
47463
47474
  modelId,
47464
47475
  apiKey,
@@ -47468,7 +47479,7 @@ ${markdown.trim()}`;
47468
47479
  });
47469
47480
  }
47470
47481
  if (providerId === "google") {
47471
- const { GoogleModel } = await import("./index-CX7FTecz.js");
47482
+ const { GoogleModel } = await import("./index-DtsWabeI.js");
47472
47483
  return new GoogleModel({
47473
47484
  modelId,
47474
47485
  apiKey
@@ -47678,4 +47689,4 @@ export {
47678
47689
  toJsonValue as t,
47679
47690
  warnOnce as w
47680
47691
  };
47681
- //# sourceMappingURL=GeoAgentControl-c10MBYNG.js.map
47692
+ //# sourceMappingURL=GeoAgentControl-C-3MIQTc.js.map