@gui-chat-plugin/map 0.1.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.
- package/README.md +96 -0
- package/dist/core/definition.d.ts +17 -0
- package/dist/core/definition.d.ts.map +1 -0
- package/dist/core/index.d.ts +5 -0
- package/dist/core/index.d.ts.map +1 -0
- package/dist/core/plugin.d.ts +8 -0
- package/dist/core/plugin.d.ts.map +1 -0
- package/dist/core/samples.d.ts +3 -0
- package/dist/core/samples.d.ts.map +1 -0
- package/dist/core/types.d.ts +10 -0
- package/dist/core/types.d.ts.map +1 -0
- package/dist/core.cjs +1 -0
- package/dist/core.js +50 -0
- package/dist/index.cjs +1 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +9 -0
- package/dist/style.css +1 -0
- package/dist/vue/Preview.vue.d.ts +9 -0
- package/dist/vue/Preview.vue.d.ts.map +1 -0
- package/dist/vue/View.vue.d.ts +10 -0
- package/dist/vue/View.vue.d.ts.map +1 -0
- package/dist/vue/index.d.ts +15 -0
- package/dist/vue/index.d.ts.map +1 -0
- package/dist/vue.cjs +1 -0
- package/dist/vue.js +88 -0
- package/package.json +49 -0
package/README.md
ADDED
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
# @gui-chat-plugin/map
|
|
2
|
+
|
|
3
|
+
[](https://www.npmjs.com/package/@gui-chat-plugin/map)
|
|
4
|
+
|
|
5
|
+
Google Map location plugin for GUI Chat applications. Display locations on an interactive map.
|
|
6
|
+
|
|
7
|
+
## Features
|
|
8
|
+
|
|
9
|
+
- Show any location by name or address
|
|
10
|
+
- Google Maps embed integration
|
|
11
|
+
- Fallback link to open in Google Maps
|
|
12
|
+
- Support for coordinates (lat/lng)
|
|
13
|
+
|
|
14
|
+
## Installation
|
|
15
|
+
|
|
16
|
+
```bash
|
|
17
|
+
yarn add @gui-chat-plugin/map
|
|
18
|
+
```
|
|
19
|
+
|
|
20
|
+
## Usage
|
|
21
|
+
|
|
22
|
+
### Vue Integration
|
|
23
|
+
|
|
24
|
+
```typescript
|
|
25
|
+
// In src/tools/index.ts
|
|
26
|
+
import MapPlugin from "@gui-chat-plugin/map/vue";
|
|
27
|
+
|
|
28
|
+
const pluginList = [
|
|
29
|
+
// ... other plugins
|
|
30
|
+
MapPlugin,
|
|
31
|
+
];
|
|
32
|
+
|
|
33
|
+
// In src/main.ts
|
|
34
|
+
import "@gui-chat-plugin/map/style.css";
|
|
35
|
+
```
|
|
36
|
+
|
|
37
|
+
### Core-only Usage
|
|
38
|
+
|
|
39
|
+
```typescript
|
|
40
|
+
import { executeMap, TOOL_DEFINITION } from "@gui-chat-plugin/map";
|
|
41
|
+
|
|
42
|
+
// Show a location
|
|
43
|
+
const result = await executeMap(context, {
|
|
44
|
+
location: "Tokyo Tower, Japan",
|
|
45
|
+
});
|
|
46
|
+
```
|
|
47
|
+
|
|
48
|
+
## API
|
|
49
|
+
|
|
50
|
+
### MapArgs
|
|
51
|
+
|
|
52
|
+
```typescript
|
|
53
|
+
interface MapArgs {
|
|
54
|
+
location: string; // Location name, address, or coordinates
|
|
55
|
+
}
|
|
56
|
+
```
|
|
57
|
+
|
|
58
|
+
### MapToolData
|
|
59
|
+
|
|
60
|
+
```typescript
|
|
61
|
+
interface MapToolData {
|
|
62
|
+
location: string | { lat: number; lng: number };
|
|
63
|
+
}
|
|
64
|
+
```
|
|
65
|
+
|
|
66
|
+
## Configuration
|
|
67
|
+
|
|
68
|
+
The plugin requires a Google Maps API key to display embedded maps. Pass it via the `googleMapKey` prop to the view component, or configure it in your app's start response.
|
|
69
|
+
|
|
70
|
+
## Development
|
|
71
|
+
|
|
72
|
+
```bash
|
|
73
|
+
# Install dependencies
|
|
74
|
+
yarn install
|
|
75
|
+
|
|
76
|
+
# Run demo
|
|
77
|
+
yarn dev
|
|
78
|
+
|
|
79
|
+
# Build
|
|
80
|
+
yarn build
|
|
81
|
+
|
|
82
|
+
# Lint
|
|
83
|
+
yarn lint
|
|
84
|
+
```
|
|
85
|
+
|
|
86
|
+
## Test Prompts
|
|
87
|
+
|
|
88
|
+
Try these prompts to test the plugin:
|
|
89
|
+
|
|
90
|
+
1. "Show me the Eiffel Tower on the map"
|
|
91
|
+
2. "Where is the Sydney Opera House located?"
|
|
92
|
+
3. "Display Tokyo Station on the map"
|
|
93
|
+
|
|
94
|
+
## License
|
|
95
|
+
|
|
96
|
+
MIT
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
export declare const TOOL_NAME = "presentMap";
|
|
2
|
+
export declare const TOOL_DEFINITION: {
|
|
3
|
+
type: "function";
|
|
4
|
+
name: string;
|
|
5
|
+
description: string;
|
|
6
|
+
parameters: {
|
|
7
|
+
type: "object";
|
|
8
|
+
properties: {
|
|
9
|
+
location: {
|
|
10
|
+
type: string;
|
|
11
|
+
description: string;
|
|
12
|
+
};
|
|
13
|
+
};
|
|
14
|
+
required: string[];
|
|
15
|
+
};
|
|
16
|
+
};
|
|
17
|
+
//# sourceMappingURL=definition.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"definition.d.ts","sourceRoot":"","sources":["../../src/core/definition.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,SAAS,eAAe,CAAC;AAEtC,eAAO,MAAM,eAAe;;;;;;;;;;;;;;CAgB3B,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/core/index.ts"],"names":[],"mappings":"AAAA,cAAc,SAAS,CAAC;AACxB,cAAc,cAAc,CAAC;AAC7B,cAAc,UAAU,CAAC;AACzB,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { ToolContext, ToolResult, ToolPluginCore } from "gui-chat-protocol";
|
|
2
|
+
import type { MapToolData, MapArgs } from "./types";
|
|
3
|
+
import { TOOL_NAME, TOOL_DEFINITION } from "./definition";
|
|
4
|
+
export declare const showMap: (_context: ToolContext, args: MapArgs) => Promise<ToolResult<MapToolData>>;
|
|
5
|
+
export declare const pluginCore: ToolPluginCore<MapToolData, unknown, MapArgs>;
|
|
6
|
+
export { TOOL_NAME, TOOL_DEFINITION };
|
|
7
|
+
export declare const executeMap: (_context: ToolContext, args: MapArgs) => Promise<ToolResult<MapToolData>>;
|
|
8
|
+
//# sourceMappingURL=plugin.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"plugin.d.ts","sourceRoot":"","sources":["../../src/core/plugin.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,UAAU,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AACjF,OAAO,KAAK,EAAE,WAAW,EAAE,OAAO,EAAE,MAAM,SAAS,CAAC;AACpD,OAAO,EAAE,SAAS,EAAE,eAAe,EAAE,MAAM,cAAc,CAAC;AAE1D,eAAO,MAAM,OAAO,GAClB,UAAU,WAAW,EACrB,MAAM,OAAO,KACZ,OAAO,CAAC,UAAU,CAAC,WAAW,CAAC,CAWjC,CAAC;AAEF,eAAO,MAAM,UAAU,EAAE,cAAc,CAAC,WAAW,EAAE,OAAO,EAAE,OAAO,CAMpE,CAAC;AAEF,OAAO,EAAE,SAAS,EAAE,eAAe,EAAE,CAAC;AACtC,eAAO,MAAM,UAAU,aAxBX,WAAW,QACf,OAAO,KACZ,OAAO,CAAC,UAAU,CAAC,WAAW,CAAC,CAsBD,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"samples.d.ts","sourceRoot":"","sources":["../../src/core/samples.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAEpD,eAAO,MAAM,OAAO,EAAE,UAAU,EAa/B,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/core/types.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,WAAW;IAC1B,QAAQ,EAAE,MAAM,GAAG;QAAE,GAAG,EAAE,MAAM,CAAC;QAAC,GAAG,EAAE,MAAM,CAAA;KAAE,CAAC;CACjD;AAED,MAAM,WAAW,OAAO;IACtB,QAAQ,EAAE,MAAM,CAAC;CAClB"}
|
package/dist/core.cjs
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t="presentMap",n={type:"function",name:t,description:"Show a location on a map by providing a location name or address",parameters:{type:"object",properties:{location:{type:"string",description:"The location name, address, or place to show on the map (e.g., 'Seattle', 'Paris, France', '123 Main St, New York')"}},required:["location"]}},o=async(a,i)=>{const{location:e}=i;if(!e||typeof e!="string")throw new Error("Location parameter is required and must be a string");return{message:`Showing ${e} on the map`,data:{location:e}}},r={toolDefinition:n,execute:o,generatingMessage:"Loading map...",isEnabled:a=>!!a?.googleMapKey,backends:["map"]},s=o,c=[{name:"Tokyo Station",args:{location:"Tokyo Station, Japan"}},{name:"Eiffel Tower",args:{location:"Eiffel Tower, Paris, France"}}];exports.TOOL_DEFINITION=n;exports.TOOL_NAME=t;exports.executeMap=s;exports.pluginCore=r;exports.samples=c;exports.showMap=o;
|
package/dist/core.js
ADDED
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
const t = "presentMap", i = {
|
|
2
|
+
type: "function",
|
|
3
|
+
name: t,
|
|
4
|
+
description: "Show a location on a map by providing a location name or address",
|
|
5
|
+
parameters: {
|
|
6
|
+
type: "object",
|
|
7
|
+
properties: {
|
|
8
|
+
location: {
|
|
9
|
+
type: "string",
|
|
10
|
+
description: "The location name, address, or place to show on the map (e.g., 'Seattle', 'Paris, France', '123 Main St, New York')"
|
|
11
|
+
}
|
|
12
|
+
},
|
|
13
|
+
required: ["location"]
|
|
14
|
+
}
|
|
15
|
+
}, a = async (o, n) => {
|
|
16
|
+
const { location: e } = n;
|
|
17
|
+
if (!e || typeof e != "string")
|
|
18
|
+
throw new Error("Location parameter is required and must be a string");
|
|
19
|
+
return {
|
|
20
|
+
message: `Showing ${e} on the map`,
|
|
21
|
+
data: { location: e }
|
|
22
|
+
};
|
|
23
|
+
}, r = {
|
|
24
|
+
toolDefinition: i,
|
|
25
|
+
execute: a,
|
|
26
|
+
generatingMessage: "Loading map...",
|
|
27
|
+
isEnabled: (o) => !!o?.googleMapKey,
|
|
28
|
+
backends: ["map"]
|
|
29
|
+
}, s = a, c = [
|
|
30
|
+
{
|
|
31
|
+
name: "Tokyo Station",
|
|
32
|
+
args: {
|
|
33
|
+
location: "Tokyo Station, Japan"
|
|
34
|
+
}
|
|
35
|
+
},
|
|
36
|
+
{
|
|
37
|
+
name: "Eiffel Tower",
|
|
38
|
+
args: {
|
|
39
|
+
location: "Eiffel Tower, Paris, France"
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
];
|
|
43
|
+
export {
|
|
44
|
+
i as TOOL_DEFINITION,
|
|
45
|
+
t as TOOL_NAME,
|
|
46
|
+
s as executeMap,
|
|
47
|
+
r as pluginCore,
|
|
48
|
+
c as samples,
|
|
49
|
+
a as showMap
|
|
50
|
+
};
|
package/dist/index.cjs
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./core.cjs");exports.TOOL_DEFINITION=e.TOOL_DEFINITION;exports.TOOL_NAME=e.TOOL_NAME;exports.executeMap=e.executeMap;exports.pluginCore=e.pluginCore;exports.samples=e.samples;exports.showMap=e.showMap;
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,QAAQ,CAAC"}
|
package/dist/index.js
ADDED
package/dist/style.css
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
@layer properties{@supports (((-webkit-hyphens:none)) and (not (margin-trim:inline))) or ((-moz-orient:inline) and (not (color:rgb(from red r g b)))){*,:before,:after,::backdrop{--tw-border-style:solid;--tw-font-weight:initial;--tw-shadow:0 0 #0000;--tw-shadow-color:initial;--tw-shadow-alpha:100%;--tw-inset-shadow:0 0 #0000;--tw-inset-shadow-color:initial;--tw-inset-shadow-alpha:100%;--tw-ring-color:initial;--tw-ring-shadow:0 0 #0000;--tw-inset-ring-color:initial;--tw-inset-ring-shadow:0 0 #0000;--tw-ring-inset:initial;--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-offset-shadow:0 0 #0000}}}@layer theme{:root,:host{--font-sans:ui-sans-serif,system-ui,sans-serif,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol","Noto Color Emoji";--font-mono:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,"Liberation Mono","Courier New",monospace;--color-red-600:oklch(57.7% .245 27.325);--color-emerald-50:oklch(97.9% .021 166.113);--color-emerald-100:oklch(95% .052 163.051);--color-emerald-200:oklch(90.5% .093 164.15);--color-emerald-800:oklch(43.2% .095 166.913);--color-blue-50:oklch(97% .014 254.604);--color-blue-600:oklch(54.6% .245 262.881);--color-blue-700:oklch(48.8% .243 264.376);--color-indigo-100:oklch(93% .034 272.788);--color-indigo-200:oklch(87% .065 274.039);--color-indigo-300:oklch(78.5% .115 274.713);--color-indigo-500:oklch(58.5% .233 277.117);--color-indigo-600:oklch(51.1% .262 276.966);--color-indigo-700:oklch(45.7% .24 277.023);--color-gray-50:oklch(98.5% .002 247.839);--color-gray-100:oklch(96.7% .003 264.542);--color-gray-200:oklch(92.8% .006 264.531);--color-gray-300:oklch(87.2% .01 258.338);--color-gray-500:oklch(55.1% .027 264.364);--color-gray-600:oklch(44.6% .03 256.802);--color-gray-800:oklch(27.8% .033 256.848);--color-white:#fff;--spacing:.25rem;--container-3xl:48rem;--text-xs:.75rem;--text-xs--line-height:calc(1/.75);--text-sm:.875rem;--text-sm--line-height:calc(1.25/.875);--text-xl:1.25rem;--text-xl--line-height:calc(1.75/1.25);--font-weight-medium:500;--font-weight-bold:700;--radius-md:.375rem;--radius-lg:.5rem;--default-transition-duration:.15s;--default-transition-timing-function:cubic-bezier(.4,0,.2,1);--default-font-family:var(--font-sans);--default-mono-font-family:var(--font-mono)}}@layer base{*,:after,:before,::backdrop{box-sizing:border-box;border:0 solid;margin:0;padding:0}::file-selector-button{box-sizing:border-box;border:0 solid;margin:0;padding:0}html,:host{-webkit-text-size-adjust:100%;tab-size:4;line-height:1.5;font-family:var(--default-font-family,ui-sans-serif,system-ui,sans-serif,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol","Noto Color Emoji");font-feature-settings:var(--default-font-feature-settings,normal);font-variation-settings:var(--default-font-variation-settings,normal);-webkit-tap-highlight-color:transparent}hr{height:0;color:inherit;border-top-width:1px}abbr:where([title]){-webkit-text-decoration:underline dotted;text-decoration:underline dotted}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;-webkit-text-decoration:inherit;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,samp,pre{font-family:var(--default-mono-font-family,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,"Liberation Mono","Courier New",monospace);font-feature-settings:var(--default-mono-font-feature-settings,normal);font-variation-settings:var(--default-mono-font-variation-settings,normal);font-size:1em}small{font-size:80%}sub,sup{vertical-align:baseline;font-size:75%;line-height:0;position:relative}sub{bottom:-.25em}sup{top:-.5em}table{text-indent:0;border-color:inherit;border-collapse:collapse}:-moz-focusring{outline:auto}progress{vertical-align:baseline}summary{display:list-item}ol,ul,menu{list-style:none}img,svg,video,canvas,audio,iframe,embed,object{vertical-align:middle;display:block}img,video{max-width:100%;height:auto}button,input,select,optgroup,textarea{font:inherit;font-feature-settings:inherit;font-variation-settings:inherit;letter-spacing:inherit;color:inherit;opacity:1;background-color:#0000;border-radius:0}::file-selector-button{font:inherit;font-feature-settings:inherit;font-variation-settings:inherit;letter-spacing:inherit;color:inherit;opacity:1;background-color:#0000;border-radius:0}:where(select:is([multiple],[size])) optgroup{font-weight:bolder}:where(select:is([multiple],[size])) optgroup option{padding-inline-start:20px}::file-selector-button{margin-inline-end:4px}::placeholder{opacity:1}@supports (not ((-webkit-appearance:-apple-pay-button))) or (contain-intrinsic-size:1px){::placeholder{color:currentColor}@supports (color:color-mix(in lab,red,red)){::placeholder{color:color-mix(in oklab,currentcolor 50%,transparent)}}}textarea{resize:vertical}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-date-and-time-value{min-height:1lh;text-align:inherit}::-webkit-datetime-edit{display:inline-flex}::-webkit-datetime-edit-fields-wrapper{padding:0}::-webkit-datetime-edit{padding-block:0}::-webkit-datetime-edit-year-field{padding-block:0}::-webkit-datetime-edit-month-field{padding-block:0}::-webkit-datetime-edit-day-field{padding-block:0}::-webkit-datetime-edit-hour-field{padding-block:0}::-webkit-datetime-edit-minute-field{padding-block:0}::-webkit-datetime-edit-second-field{padding-block:0}::-webkit-datetime-edit-millisecond-field{padding-block:0}::-webkit-datetime-edit-meridiem-field{padding-block:0}::-webkit-calendar-picker-indicator{line-height:1}:-moz-ui-invalid{box-shadow:none}button,input:where([type=button],[type=reset],[type=submit]){appearance:button}::file-selector-button{appearance:button}::-webkit-inner-spin-button{height:auto}::-webkit-outer-spin-button{height:auto}[hidden]:where(:not([hidden=until-found])){display:none!important}}@layer components;@layer utilities{.m-0{margin:calc(var(--spacing)*0)}.mx-auto{margin-inline:auto}.mt-1{margin-top:calc(var(--spacing)*1)}.mt-3{margin-top:calc(var(--spacing)*3)}.mt-4{margin-top:calc(var(--spacing)*4)}.mb-2{margin-bottom:calc(var(--spacing)*2)}.mb-3{margin-bottom:calc(var(--spacing)*3)}.mb-4{margin-bottom:calc(var(--spacing)*4)}.mb-5{margin-bottom:calc(var(--spacing)*5)}.mb-8{margin-bottom:calc(var(--spacing)*8)}.block{display:block}.flex{display:flex}.inline-block{display:inline-block}.h-full{height:100%}.min-h-0{min-height:calc(var(--spacing)*0)}.w-full{width:100%}.max-w-3xl{max-width:var(--container-3xl)}.max-w-\[200px\]{max-width:200px}.flex-1{flex:1}.cursor-pointer{cursor:pointer}.resize-y{resize:vertical}.flex-col{flex-direction:column}.flex-wrap{flex-wrap:wrap}.items-center{align-items:center}.justify-center{justify-content:center}.gap-2{gap:calc(var(--spacing)*2)}.gap-3{gap:calc(var(--spacing)*3)}.truncate{text-overflow:ellipsis;white-space:nowrap;overflow:hidden}.overflow-x-auto{overflow-x:auto}.rounded{border-radius:.25rem}.rounded-lg{border-radius:var(--radius-lg)}.rounded-md{border-radius:var(--radius-md)}.border{border-style:var(--tw-border-style);border-width:1px}.border-0{border-style:var(--tw-border-style);border-width:0}.border-none{--tw-border-style:none;border-style:none}.border-emerald-200{border-color:var(--color-emerald-200)}.border-gray-200{border-color:var(--color-gray-200)}.border-gray-300{border-color:var(--color-gray-300)}.border-indigo-200{border-color:var(--color-indigo-200)}.bg-blue-50{background-color:var(--color-blue-50)}.bg-blue-600{background-color:var(--color-blue-600)}.bg-emerald-50{background-color:var(--color-emerald-50)}.bg-emerald-100{background-color:var(--color-emerald-100)}.bg-gray-50{background-color:var(--color-gray-50)}.bg-gray-100{background-color:var(--color-gray-100)}.bg-indigo-100{background-color:var(--color-indigo-100)}.bg-indigo-600{background-color:var(--color-indigo-600)}.bg-white{background-color:var(--color-white)}.p-3{padding:calc(var(--spacing)*3)}.p-4{padding:calc(var(--spacing)*4)}.p-5{padding:calc(var(--spacing)*5)}.p-8{padding:calc(var(--spacing)*8)}.px-4{padding-inline:calc(var(--spacing)*4)}.px-6{padding-inline:calc(var(--spacing)*6)}.py-2{padding-block:calc(var(--spacing)*2)}.py-2\.5{padding-block:calc(var(--spacing)*2.5)}.text-center{text-align:center}.font-mono{font-family:var(--font-mono)}.text-sm{font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height))}.text-xl{font-size:var(--text-xl);line-height:var(--tw-leading,var(--text-xl--line-height))}.text-xs{font-size:var(--text-xs);line-height:var(--tw-leading,var(--text-xs--line-height))}.font-bold{--tw-font-weight:var(--font-weight-bold);font-weight:var(--font-weight-bold)}.font-medium{--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium)}.whitespace-pre-wrap{white-space:pre-wrap}.text-blue-600{color:var(--color-blue-600)}.text-emerald-800{color:var(--color-emerald-800)}.text-gray-500{color:var(--color-gray-500)}.text-gray-600{color:var(--color-gray-600)}.text-gray-800{color:var(--color-gray-800)}.text-indigo-700{color:var(--color-indigo-700)}.text-red-600{color:var(--color-red-600)}.text-white{color:var(--color-white)}.shadow-md{--tw-shadow:0 4px 6px -1px var(--tw-shadow-color,#0000001a),0 2px 4px -2px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.transition-all{transition-property:all;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-colors{transition-property:color,background-color,border-color,outline-color,text-decoration-color,fill,stroke,--tw-gradient-from,--tw-gradient-via,--tw-gradient-to;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}@media(hover:hover){.hover\:border-indigo-300:hover{border-color:var(--color-indigo-300)}.hover\:bg-blue-700:hover{background-color:var(--color-blue-700)}.hover\:bg-indigo-200:hover{background-color:var(--color-indigo-200)}.hover\:bg-indigo-700:hover{background-color:var(--color-indigo-700)}}.focus\:border-indigo-500:focus{border-color:var(--color-indigo-500)}.focus\:ring-\[3px\]:focus{--tw-ring-shadow:var(--tw-ring-inset,)0 0 0 calc(3px + var(--tw-ring-offset-width))var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.focus\:ring-indigo-500\/10:focus{--tw-ring-color:#625fff1a}@supports (color:color-mix(in lab,red,red)){.focus\:ring-indigo-500\/10:focus{--tw-ring-color:color-mix(in oklab,var(--color-indigo-500)10%,transparent)}}.focus\:outline-none:focus{--tw-outline-style:none;outline-style:none}}@property --tw-border-style{syntax:"*";inherits:false;initial-value:solid}@property --tw-font-weight{syntax:"*";inherits:false}@property --tw-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-shadow-color{syntax:"*";inherits:false}@property --tw-shadow-alpha{syntax:"<percentage>";inherits:false;initial-value:100%}@property --tw-inset-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-inset-shadow-color{syntax:"*";inherits:false}@property --tw-inset-shadow-alpha{syntax:"<percentage>";inherits:false;initial-value:100%}@property --tw-ring-color{syntax:"*";inherits:false}@property --tw-ring-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-inset-ring-color{syntax:"*";inherits:false}@property --tw-inset-ring-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-ring-inset{syntax:"*";inherits:false}@property --tw-ring-offset-width{syntax:"<length>";inherits:false;initial-value:0}@property --tw-ring-offset-color{syntax:"*";inherits:false;initial-value:#fff}@property --tw-ring-offset-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { ToolResult } from "gui-chat-protocol";
|
|
2
|
+
import type { MapToolData } from "../core/types";
|
|
3
|
+
type __VLS_Props = {
|
|
4
|
+
result: ToolResult<MapToolData>;
|
|
5
|
+
};
|
|
6
|
+
declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
7
|
+
declare const _default: typeof __VLS_export;
|
|
8
|
+
export default _default;
|
|
9
|
+
//# sourceMappingURL=Preview.vue.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Preview.vue.d.ts","sourceRoot":"","sources":["../../src/vue/Preview.vue"],"names":[],"mappings":"AAwBA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AACpD,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAEjD,KAAK,WAAW,GAAG;IACjB,MAAM,EAAE,UAAU,CAAC,WAAW,CAAC,CAAC;CACjC,CAAC;AA4CF,QAAA,MAAM,YAAY,kSAEhB,CAAC;wBACkB,OAAO,YAAY;AAAxC,wBAAyC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { ToolResult } from "gui-chat-protocol";
|
|
2
|
+
import type { MapToolData } from "../core/types";
|
|
3
|
+
type __VLS_Props = {
|
|
4
|
+
selectedResult: ToolResult<MapToolData> | null;
|
|
5
|
+
googleMapKey?: string | null;
|
|
6
|
+
};
|
|
7
|
+
declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
8
|
+
declare const _default: typeof __VLS_export;
|
|
9
|
+
export default _default;
|
|
10
|
+
//# sourceMappingURL=View.vue.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"View.vue.d.ts","sourceRoot":"","sources":["../../src/vue/View.vue"],"names":[],"mappings":"AAsEA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AACpD,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAEjD,KAAK,WAAW,GAAG;IACjB,cAAc,EAAE,UAAU,CAAC,WAAW,CAAC,GAAG,IAAI,CAAC;IAC/C,YAAY,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;CAC9B,CAAC;AA4IF,QAAA,MAAM,YAAY,kSAEhB,CAAC;wBACkB,OAAO,YAAY;AAAxC,wBAAyC"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import "../style.css";
|
|
2
|
+
import type { ToolPlugin } from "gui-chat-protocol/vue";
|
|
3
|
+
import type { MapToolData, MapArgs } from "../core/types";
|
|
4
|
+
import View from "./View.vue";
|
|
5
|
+
import Preview from "./Preview.vue";
|
|
6
|
+
export declare const plugin: ToolPlugin<MapToolData, unknown, MapArgs>;
|
|
7
|
+
export type { MapToolData, MapArgs } from "../core/types";
|
|
8
|
+
export { TOOL_NAME, TOOL_DEFINITION, executeMap, pluginCore, } from "../core/plugin";
|
|
9
|
+
export { samples } from "../core/samples";
|
|
10
|
+
export { View, Preview };
|
|
11
|
+
declare const _default: {
|
|
12
|
+
plugin: ToolPlugin<MapToolData, unknown, MapArgs, import("gui-chat-protocol/vue").InputHandler, Record<string, unknown>>;
|
|
13
|
+
};
|
|
14
|
+
export default _default;
|
|
15
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/vue/index.ts"],"names":[],"mappings":"AAAA,OAAO,cAAc,CAAC;AAEtB,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAC;AACxD,OAAO,KAAK,EAAE,WAAW,EAAE,OAAO,EAAE,MAAM,eAAe,CAAC;AAG1D,OAAO,IAAI,MAAM,YAAY,CAAC;AAC9B,OAAO,OAAO,MAAM,eAAe,CAAC;AAEpC,eAAO,MAAM,MAAM,EAAE,UAAU,CAAC,WAAW,EAAE,OAAO,EAAE,OAAO,CAK5D,CAAC;AAEF,YAAY,EAAE,WAAW,EAAE,OAAO,EAAE,MAAM,eAAe,CAAC;AAE1D,OAAO,EACL,SAAS,EACT,eAAe,EACf,UAAU,EACV,UAAU,GACX,MAAM,gBAAgB,CAAC;AAExB,OAAO,EAAE,OAAO,EAAE,MAAM,iBAAiB,CAAC;AAE1C,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,CAAC;;;;AAEzB,wBAA0B"}
|
package/dist/vue.cjs
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const l=require("./core.cjs"),e=require("vue"),p={class:"w-full h-full p-4 bg-white"},m={key:0,class:"h-full flex flex-col"},g={class:"mb-4"},f={class:"text-gray-600"},y={class:"flex-1 min-h-0"},v=["src"],_={key:1,class:"w-full h-full flex items-center justify-center bg-gray-100 rounded-lg"},x={class:"text-center p-8"},h=["href"],E={key:1,class:"h-full flex items-center justify-center"},c=e.defineComponent({__name:"View",props:{selectedResult:{},googleMapKey:{}},setup(o){const a=o,n=e.computed(()=>{const t=a.selectedResult?.data?.location;return t?typeof t=="string"?t:`${t.lat}, ${t.lng}`:""}),d=e.computed(()=>{if(!a.googleMapKey||!a.selectedResult?.data?.location)return"";const t=n.value;return`https://www.google.com/maps/embed/v1/place?key=${a.googleMapKey}&q=${encodeURIComponent(t)}`}),u=e.computed(()=>{const t=n.value;return`https://www.google.com/maps/search/?api=1&query=${encodeURIComponent(t)}`});return(t,s)=>(e.openBlock(),e.createElementBlock("div",p,[o.selectedResult?.data?.location?(e.openBlock(),e.createElementBlock("div",m,[e.createElementVNode("div",g,[s[0]||(s[0]=e.createElementVNode("h2",{class:"text-xl font-bold text-gray-800"},"Map Location",-1)),e.createElementVNode("p",f,e.toDisplayString(n.value),1)]),e.createElementVNode("div",y,[o.googleMapKey?(e.openBlock(),e.createElementBlock("iframe",{key:0,src:d.value,class:"w-full h-full border-0 rounded-lg",allowfullscreen:"",loading:"lazy",referrerpolicy:"no-referrer-when-downgrade"},null,8,v)):(e.openBlock(),e.createElementBlock("div",_,[e.createElementVNode("div",x,[s[1]||(s[1]=e.createElementVNode("div",{class:"text-gray-500 mb-4"},"Google Maps API key not configured",-1)),e.createElementVNode("a",{href:u.value,target:"_blank",class:"inline-block px-4 py-2 bg-blue-600 text-white rounded hover:bg-blue-700 transition-colors"}," Open in Google Maps ",8,h)])]))])])):(e.openBlock(),e.createElementBlock("div",E,[...s[2]||(s[2]=[e.createElementVNode("div",{class:"text-gray-500"},"No location data available",-1)])]))]))}}),b={class:"text-center p-4 bg-blue-50 rounded"},k={class:"text-xs text-gray-600 mt-1 truncate"},r=e.defineComponent({__name:"Preview",props:{result:{}},setup(o){return(a,n)=>(e.openBlock(),e.createElementBlock("div",b,[n[0]||(n[0]=e.createElementVNode("div",{class:"text-blue-600 font-medium"},"Map Location",-1)),e.createElementVNode("div",k,e.toDisplayString(typeof o.result.data?.location=="string"?o.result.data.location:`${o.result.data?.location?.lat}, ${o.result.data?.location?.lng}`),1)]))}}),i={...l.pluginCore,viewComponent:c,previewComponent:r,samples:l.samples},w={plugin:i};exports.TOOL_DEFINITION=l.TOOL_DEFINITION;exports.TOOL_NAME=l.TOOL_NAME;exports.executeMap=l.executeMap;exports.pluginCore=l.pluginCore;exports.samples=l.samples;exports.Preview=r;exports.View=c;exports.default=w;exports.plugin=i;
|
package/dist/vue.js
ADDED
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
import { samples as g, pluginCore as f } from "./core.js";
|
|
2
|
+
import { TOOL_DEFINITION as P, TOOL_NAME as T, executeMap as V } from "./core.js";
|
|
3
|
+
import { defineComponent as c, computed as i, createElementBlock as n, openBlock as a, createElementVNode as t, toDisplayString as d } from "vue";
|
|
4
|
+
const m = { class: "w-full h-full p-4 bg-white" }, y = {
|
|
5
|
+
key: 0,
|
|
6
|
+
class: "h-full flex flex-col"
|
|
7
|
+
}, x = { class: "mb-4" }, v = { class: "text-gray-600" }, h = { class: "flex-1 min-h-0" }, _ = ["src"], w = {
|
|
8
|
+
key: 1,
|
|
9
|
+
class: "w-full h-full flex items-center justify-center bg-gray-100 rounded-lg"
|
|
10
|
+
}, b = { class: "text-center p-8" }, M = ["href"], k = {
|
|
11
|
+
key: 1,
|
|
12
|
+
class: "h-full flex items-center justify-center"
|
|
13
|
+
}, $ = /* @__PURE__ */ c({
|
|
14
|
+
__name: "View",
|
|
15
|
+
props: {
|
|
16
|
+
selectedResult: {},
|
|
17
|
+
googleMapKey: {}
|
|
18
|
+
},
|
|
19
|
+
setup(o) {
|
|
20
|
+
const r = o, l = i(() => {
|
|
21
|
+
const e = r.selectedResult?.data?.location;
|
|
22
|
+
return e ? typeof e == "string" ? e : `${e.lat}, ${e.lng}` : "";
|
|
23
|
+
}), u = i(() => {
|
|
24
|
+
if (!r.googleMapKey || !r.selectedResult?.data?.location) return "";
|
|
25
|
+
const e = l.value;
|
|
26
|
+
return `https://www.google.com/maps/embed/v1/place?key=${r.googleMapKey}&q=${encodeURIComponent(e)}`;
|
|
27
|
+
}), p = i(() => {
|
|
28
|
+
const e = l.value;
|
|
29
|
+
return `https://www.google.com/maps/search/?api=1&query=${encodeURIComponent(e)}`;
|
|
30
|
+
});
|
|
31
|
+
return (e, s) => (a(), n("div", m, [
|
|
32
|
+
o.selectedResult?.data?.location ? (a(), n("div", y, [
|
|
33
|
+
t("div", x, [
|
|
34
|
+
s[0] || (s[0] = t("h2", { class: "text-xl font-bold text-gray-800" }, "Map Location", -1)),
|
|
35
|
+
t("p", v, d(l.value), 1)
|
|
36
|
+
]),
|
|
37
|
+
t("div", h, [
|
|
38
|
+
o.googleMapKey ? (a(), n("iframe", {
|
|
39
|
+
key: 0,
|
|
40
|
+
src: u.value,
|
|
41
|
+
class: "w-full h-full border-0 rounded-lg",
|
|
42
|
+
allowfullscreen: "",
|
|
43
|
+
loading: "lazy",
|
|
44
|
+
referrerpolicy: "no-referrer-when-downgrade"
|
|
45
|
+
}, null, 8, _)) : (a(), n("div", w, [
|
|
46
|
+
t("div", b, [
|
|
47
|
+
s[1] || (s[1] = t("div", { class: "text-gray-500 mb-4" }, "Google Maps API key not configured", -1)),
|
|
48
|
+
t("a", {
|
|
49
|
+
href: p.value,
|
|
50
|
+
target: "_blank",
|
|
51
|
+
class: "inline-block px-4 py-2 bg-blue-600 text-white rounded hover:bg-blue-700 transition-colors"
|
|
52
|
+
}, " Open in Google Maps ", 8, M)
|
|
53
|
+
])
|
|
54
|
+
]))
|
|
55
|
+
])
|
|
56
|
+
])) : (a(), n("div", k, [...s[2] || (s[2] = [
|
|
57
|
+
t("div", { class: "text-gray-500" }, "No location data available", -1)
|
|
58
|
+
])]))
|
|
59
|
+
]));
|
|
60
|
+
}
|
|
61
|
+
}), C = { class: "text-center p-4 bg-blue-50 rounded" }, I = { class: "text-xs text-gray-600 mt-1 truncate" }, O = /* @__PURE__ */ c({
|
|
62
|
+
__name: "Preview",
|
|
63
|
+
props: {
|
|
64
|
+
result: {}
|
|
65
|
+
},
|
|
66
|
+
setup(o) {
|
|
67
|
+
return (r, l) => (a(), n("div", C, [
|
|
68
|
+
l[0] || (l[0] = t("div", { class: "text-blue-600 font-medium" }, "Map Location", -1)),
|
|
69
|
+
t("div", I, d(typeof o.result.data?.location == "string" ? o.result.data.location : `${o.result.data?.location?.lat}, ${o.result.data?.location?.lng}`), 1)
|
|
70
|
+
]));
|
|
71
|
+
}
|
|
72
|
+
}), R = {
|
|
73
|
+
...f,
|
|
74
|
+
viewComponent: $,
|
|
75
|
+
previewComponent: O,
|
|
76
|
+
samples: g
|
|
77
|
+
}, N = { plugin: R };
|
|
78
|
+
export {
|
|
79
|
+
O as Preview,
|
|
80
|
+
P as TOOL_DEFINITION,
|
|
81
|
+
T as TOOL_NAME,
|
|
82
|
+
$ as View,
|
|
83
|
+
N as default,
|
|
84
|
+
V as executeMap,
|
|
85
|
+
R as plugin,
|
|
86
|
+
f as pluginCore,
|
|
87
|
+
g as samples
|
|
88
|
+
};
|
package/package.json
ADDED
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@gui-chat-plugin/map",
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"type": "module",
|
|
5
|
+
"description": "Google Map location plugin for GUI Chat applications",
|
|
6
|
+
"author": "receptron",
|
|
7
|
+
"license": "MIT",
|
|
8
|
+
"main": "./dist/index.cjs",
|
|
9
|
+
"module": "./dist/index.js",
|
|
10
|
+
"types": "./dist/index.d.ts",
|
|
11
|
+
"exports": {
|
|
12
|
+
".": {
|
|
13
|
+
"types": "./dist/index.d.ts",
|
|
14
|
+
"import": "./dist/index.js",
|
|
15
|
+
"require": "./dist/index.cjs"
|
|
16
|
+
},
|
|
17
|
+
"./vue": {
|
|
18
|
+
"types": "./dist/vue/index.d.ts",
|
|
19
|
+
"import": "./dist/vue.js",
|
|
20
|
+
"require": "./dist/vue.cjs"
|
|
21
|
+
},
|
|
22
|
+
"./style.css": "./dist/style.css"
|
|
23
|
+
},
|
|
24
|
+
"files": [
|
|
25
|
+
"dist"
|
|
26
|
+
],
|
|
27
|
+
"scripts": {
|
|
28
|
+
"dev": "vite",
|
|
29
|
+
"build": "vite build && vue-tsc -p tsconfig.build.json --emitDeclarationOnly",
|
|
30
|
+
"typecheck": "vue-tsc --noEmit",
|
|
31
|
+
"lint": "eslint src"
|
|
32
|
+
},
|
|
33
|
+
"dependencies": {
|
|
34
|
+
"gui-chat-protocol": "^0.0.1"
|
|
35
|
+
},
|
|
36
|
+
"devDependencies": {
|
|
37
|
+
"@tailwindcss/vite": "^4.1.0",
|
|
38
|
+
"@vitejs/plugin-vue": "^6.0.0",
|
|
39
|
+
"eslint": "^9.0.0",
|
|
40
|
+
"tailwindcss": "^4.1.0",
|
|
41
|
+
"typescript": "^5.8.0",
|
|
42
|
+
"vite": "^7.0.0",
|
|
43
|
+
"vue": "^3.5.0",
|
|
44
|
+
"vue-tsc": "^3.0.0"
|
|
45
|
+
},
|
|
46
|
+
"peerDependencies": {
|
|
47
|
+
"vue": "^3.5.0"
|
|
48
|
+
}
|
|
49
|
+
}
|