{"_id":"@astii/monaco-chat","_rev":"6-ccb3d0fa0f7b9212bb81fcdfc01ea0bb","name":"@astii/monaco-chat","dist-tags":{"latest":"0.0.6"},"versions":{"0.0.1":{"name":"@astii/monaco-chat","version":"0.0.1","keywords":["monaco-editor","chat","AI"],"license":"MIT","_id":"@astii/monaco-chat@0.0.1","maintainers":[{"name":"tangxiaoxin","email":"1302947749@qq.com"}],"dist":{"shasum":"7078af5e54231ba3fe47597921e393b9fa7f3d30","tarball":"https://registry.npmjs.org/@astii/monaco-chat/-/monaco-chat-0.0.1.tgz","fileCount":88,"integrity":"sha512-qUAsDwHk5dx1Iuy1egyxpIhQQl7KSBe+R7UrU1H0YdFGiu58Puo4S1KzZaZE0FbjO1ElsVkz9APQQpF3ehIcnQ==","signatures":[{"sig":"MEQCIG0fFiiIJbVXfGVElGuWA/HaOHu48dmFYeRdALEt/BdFAiBvTsRftjg3XDZqNO+mu5dBg6RAbWkibZM9QUAIjd/OoQ==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":240915},"main":"dist/lib/index.js","types":"dist/esm/index.d.ts","module":"dist/esm/index.js","authors":["1302947749@qq.com"],"gitHead":"0d729f268c6386761446ea1848598c06911932fc","scripts":{"dev":"father dev","build":"father build","release":"npm version patch && npm run build && npm publish","build:deps":"father prebundle","prepublishOnly":"father doctor && npm run build"},"_npmUser":{"name":"tangxiaoxin","email":"1302947749@qq.com"},"_npmVersion":"10.8.2","description":"monaco-editor inline chat","directories":{},"_nodeVersion":"18.19.0","dependencies":{"ast-types":"^0.14.2","@babel/parser":"^7.25.3","react-markdown":"^9.0.1","react-syntax-highlighter":"^15.5.0","@microsoft/fetch-event-source":"^2.0.1"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"father":"^4.5.0","@types/react-syntax-highlighter":"^15.5.13"},"peerDependencies":{"react":"^17.0.2","react-dom":"^17.0.2"},"_npmOperationalInternal":{"tmp":"tmp/monaco-chat_0.0.1_1734080164878_0.32525643762233125","host":"s3://npm-registry-packages-npm-production"}},"0.0.2":{"name":"@astii/monaco-chat","version":"0.0.2","keywords":["monaco-editor","chat","AI"],"license":"MIT","_id":"@astii/monaco-chat@0.0.2","maintainers":[{"name":"tangxiaoxin","email":"1302947749@qq.com"}],"dist":{"shasum":"57095f0fff13c900198885dbecbf1e06eb7f4048","tarball":"https://registry.npmjs.org/@astii/monaco-chat/-/monaco-chat-0.0.2.tgz","fileCount":88,"integrity":"sha512-xlVBSSiaoY5UqHOxvlOGG81U9Zg7LS+z0cX0WH0A4IT76nGAMip++wyyUDhPnX7pmpw+t3exEnu9HLiZWWSYCA==","signatures":[{"sig":"MEUCIQCeHlcMitHWKFyv3mRBMSf5s6N1jIted1z4jE9G00v2BgIgexYRUHg4q90wuITt4iZ/Ywc3f0KzpE4FhvDo1r9DFIQ=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":261474},"main":"lib/index.js","types":"esm/index.d.ts","module":"esm/index.js","authors":["1302947749@qq.com"],"gitHead":"1542a7c7c3cc46317275f376c2026cf12e7ada7c","scripts":{"dev":"father dev","build":"father build","release":"npm version patch && npm run build && npm publish","build:deps":"father prebundle","prepublishOnly":"father doctor && npm run build"},"_npmUser":{"name":"tangxiaoxin","email":"1302947749@qq.com"},"_npmVersion":"10.8.2","description":"monaco-editor inline chat","directories":{},"_nodeVersion":"18.19.0","dependencies":{"ast-types":"^0.14.2","@babel/parser":"^7.25.3","react-markdown":"^9.0.1","react-syntax-highlighter":"^15.5.0","@microsoft/fetch-event-source":"^2.0.1"},"publishConfig":{"access":"public","registry":"https://registry.npmjs.org"},"_hasShrinkwrap":false,"devDependencies":{"father":"^4.5.0","@types/react-syntax-highlighter":"^15.5.13"},"peerDependencies":{"react":"^17.0.2","react-dom":"^17.0.2"},"_npmOperationalInternal":{"tmp":"tmp/monaco-chat_0.0.2_1735893679210_0.843295841708982","host":"s3://npm-registry-packages-npm-production"}},"0.0.3":{"name":"@astii/monaco-chat","version":"0.0.3","keywords":["monaco-editor","chat","AI"],"license":"MIT","_id":"@astii/monaco-chat@0.0.3","maintainers":[{"name":"tangxiaoxin","email":"1302947749@qq.com"}],"dist":{"shasum":"5a7d3e259661174df4fe414d6d7c17ba88a5bbe9","tarball":"https://registry.npmjs.org/@astii/monaco-chat/-/monaco-chat-0.0.3.tgz","fileCount":94,"integrity":"sha512-WY9zQql6XLDXkN77Hwi5Cy/zuhHbHVQ8Qj5ZkpOMKLNH5VuX+4yQrJDI781stK6XF4RSx/P3sIgHYRSDIw8++g==","signatures":[{"sig":"MEQCIDNevQHKGhDUksuKX3pmxgbvI55YC5w/nrtWSID03vz7AiAlSDhQtdBfDpjEDfoDN4cu1FreQYfF4DG+Cky7FRw77Q==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":265646},"main":"lib/index.js","types":"esm/index.d.ts","module":"esm/index.js","authors":["1302947749@qq.com"],"gitHead":"ce7cfdbca2ff2f6b29331c66738ddbac27acf10d","scripts":{"dev":"father dev","build":"father build","release":"npm version patch && npm run build && npm publish","build:deps":"father prebundle","prepublishOnly":"father doctor && npm run build"},"_npmUser":{"name":"tangxiaoxin","email":"1302947749@qq.com"},"_npmVersion":"10.8.2","description":"monaco-editor inline chat","directories":{},"_nodeVersion":"18.19.0","dependencies":{"ast-types":"^0.14.2","@babel/parser":"^7.25.3","react-markdown":"^9.0.1","react-syntax-highlighter":"^15.5.0","@microsoft/fetch-event-source":"^2.0.1"},"publishConfig":{"access":"public","registry":"https://registry.npmjs.org"},"_hasShrinkwrap":false,"devDependencies":{"father":"^4.5.0","@types/react-syntax-highlighter":"^15.5.13"},"peerDependencies":{"react":"^17.0.2","react-dom":"^17.0.2"},"_npmOperationalInternal":{"tmp":"tmp/monaco-chat_0.0.3_1741851694227_0.7732236328917321","host":"s3://npm-registry-packages-npm-production"}},"0.0.4":{"name":"@astii/monaco-chat","version":"0.0.4","keywords":["monaco-editor","chat","AI"],"license":"MIT","_id":"@astii/monaco-chat@0.0.4","maintainers":[{"name":"tangxiaoxin","email":"1302947749@qq.com"}],"dist":{"shasum":"9e105aea12ba0a6453aa76b198100b880982023d","tarball":"https://registry.npmjs.org/@astii/monaco-chat/-/monaco-chat-0.0.4.tgz","fileCount":94,"integrity":"sha512-Mb04dL6SsTA9MF8T26rMKbNpfiXyJWem7O81YZ0k53rfxcMSsu5ByrIv3og5hVCnxLVGrUyyOqmVRTcucNVs9Q==","signatures":[{"sig":"MEYCIQCsfbsEegJx1YPZ66ZAazV3lw7+SOhQryPSypQCygJynAIhAJ4qe1leESuCpEJ6NpzbLRYuVg4XEaj/F0VfE0RRWoLE","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":268400},"main":"lib/index.js","types":"esm/index.d.ts","module":"esm/index.js","authors":["1302947749@qq.com"],"gitHead":"b292dc2ecb8ec6ccbb008f18cb96f331ddc208d0","scripts":{"dev":"father dev","build":"father build","release":"npm version patch && npm run build && npm publish","build:deps":"father prebundle","prepublishOnly":"father doctor && npm run build"},"_npmUser":{"name":"tangxiaoxin","email":"1302947749@qq.com"},"_npmVersion":"10.8.2","description":"monaco-editor inline chat","directories":{},"_nodeVersion":"18.19.0","dependencies":{"ast-types":"^0.14.2","@babel/parser":"^7.25.3","react-markdown":"^9.0.1","react-syntax-highlighter":"^15.5.0","@microsoft/fetch-event-source":"^2.0.1"},"publishConfig":{"access":"public","registry":"https://registry.npmjs.org"},"_hasShrinkwrap":false,"devDependencies":{"father":"^4.5.0","@types/react-syntax-highlighter":"^15.5.13"},"peerDependencies":{"react":"^17.0.2","react-dom":"^17.0.2"},"_npmOperationalInternal":{"tmp":"tmp/monaco-chat_0.0.4_1742216428982_0.5599321451406398","host":"s3://npm-registry-packages-npm-production"}},"0.0.5":{"name":"@astii/monaco-chat","version":"0.0.5","keywords":["monaco-editor","chat","AI"],"license":"MIT","_id":"@astii/monaco-chat@0.0.5","maintainers":[{"name":"tangxiaoxin","email":"1302947749@qq.com"}],"dist":{"shasum":"2881dc7d5071747080c41eb0c9895417d5b70949","tarball":"https://registry.npmjs.org/@astii/monaco-chat/-/monaco-chat-0.0.5.tgz","fileCount":94,"integrity":"sha512-wA2El2SvvwmZXycFW3OGv0Kg9Zaw3yG9A6okATL2zRJzTd1z9HItpBk+yosSlfB9LMGUETsDqN2tb5sre14QgQ==","signatures":[{"sig":"MEYCIQCiJ4XlycHtYx8A7uAE/kW+F1t06KSlBKIeEYfIP8oZEAIhAP7J9n8R3Y6+oZysnaUWp+DFj3er+KJAEImmZeO4KJ0v","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":268831},"main":"lib/index.js","types":"esm/index.d.ts","module":"esm/index.js","authors":["1302947749@qq.com"],"gitHead":"fb71cf1e18429e791f37154ee154fff1e9c50466","scripts":{"dev":"father dev","build":"father build","release":"npm version patch && npm run build && npm publish","build:deps":"father prebundle","prepublishOnly":"father doctor && npm run build"},"_npmUser":{"name":"tangxiaoxin","email":"1302947749@qq.com"},"_npmVersion":"10.8.2","description":"monaco-editor inline chat","directories":{},"_nodeVersion":"18.19.0","dependencies":{"ast-types":"^0.14.2","@babel/parser":"^7.25.3","react-markdown":"^9.0.1","react-syntax-highlighter":"^15.5.0","@microsoft/fetch-event-source":"^2.0.1"},"publishConfig":{"access":"public","registry":"https://registry.npmjs.org"},"_hasShrinkwrap":false,"devDependencies":{"father":"^4.5.0","@types/react-syntax-highlighter":"^15.5.13"},"peerDependencies":{"react":"^17.0.2","react-dom":"^17.0.2"},"_npmOperationalInternal":{"tmp":"tmp/monaco-chat_0.0.5_1742280358293_0.123276068505352","host":"s3://npm-registry-packages-npm-production"}},"0.0.6":{"name":"@astii/monaco-chat","version":"0.0.6","description":"monaco-editor inline chat","main":"lib/index.js","module":"esm/index.js","types":"esm/index.d.ts","scripts":{"dev":"father dev","build":"father build","build:deps":"father prebundle","prepublishOnly":"father doctor && npm run build","release":"npm version patch && npm run build && npm publish"},"keywords":["monaco-editor","chat","AI"],"authors":["1302947749@qq.com"],"license":"MIT","publishConfig":{"access":"public","registry":"https://registry.npmjs.org"},"devDependencies":{"@types/react-syntax-highlighter":"^15.5.13","father":"^4.5.0"},"dependencies":{"@babel/parser":"^7.25.3","@microsoft/fetch-event-source":"^2.0.1","ast-types":"^0.14.2","react-markdown":"^9.0.1","react-syntax-highlighter":"^15.5.0"},"peerDependencies":{"react":">=18","react-dom":">=18"},"_id":"@astii/monaco-chat@0.0.6","gitHead":"4edc4f4232c8750b0c695dbdee609b20996f8ca1","_nodeVersion":"18.20.0","_npmVersion":"10.5.0","dist":{"integrity":"sha512-H2wjJp1lANfq6v+CsO4C76id7Vc0LWmMEpDHN93e/8V8IiU99raRIh3FsBfWG0yboU0rlgFe68B/fGIIV7amGg==","shasum":"d32c8682dc70952081e7c37835ae786d260ed5d3","tarball":"https://registry.npmjs.org/@astii/monaco-chat/-/monaco-chat-0.0.6.tgz","fileCount":94,"unpackedSize":272127,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEQCIHz1oP+0mKRjWrbuA+4MalsnsDCBh0nT4DpZ1BUHzM1NAiBVl29qLgf+12LxOed9N9fAvilER0aFPKBjHnSxoG4hqg=="}]},"_npmUser":{"name":"tangxiaoxin","email":"1302947749@qq.com"},"directories":{},"maintainers":[{"name":"tangxiaoxin","email":"1302947749@qq.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/monaco-chat_0.0.6_1744104892446_0.8562463738073833"},"_hasShrinkwrap":false}},"time":{"created":"2024-12-13T08:56:04.794Z","modified":"2025-04-08T09:34:52.820Z","0.0.1":"2024-12-13T08:56:05.084Z","0.0.2":"2025-01-03T08:41:19.378Z","0.0.3":"2025-03-13T07:41:34.431Z","0.0.4":"2025-03-17T13:00:29.193Z","0.0.5":"2025-03-18T06:45:58.465Z","0.0.6":"2025-04-08T09:34:52.654Z"},"license":"MIT","keywords":["monaco-editor","chat","AI"],"description":"monaco-editor inline chat","maintainers":[{"name":"tangxiaoxin","email":"1302947749@qq.com"}],"readme":"# @astii/monaco-chat\n\n[![NPM version](https://img.shields.io/npm/v/@astii/monaco-chat.svg?style=flat)](https://npmjs.com/package/@astii/monaco-chat)\n[![NPM downloads](http://img.shields.io/npm/dm/@astii/monaco-chat.svg?style=flat)](https://npmjs.com/package/@astii/monaco-chat)\n\ninline AI chat tool for monaco-editor. with tool can use any model which response based on SSE\n\n![shot](https://p4-ec.eckwai.com/kos/nlav12333/monaco/chat.gif)\n\n## Install\n\n```bash\n$ npm install @astii/monaco-chat\n```\n\n## Usage\n\n```ts\nimport { registerChat } from \"@astii/monaco-chat\";\n\nuseEffect(() => {\n  if (!monaco || !editor) return;\n  const dispose = registerChat(monaco, editor, {\n    language: \"typescript\",\n    request: new Request(\"\", {\n      method: \"POST\",\n      headers: {\n        \"x-dmo-provider\": \"\",\n        authorization: \"Bearer \",\n        \"Content-Type\": \"application/json\",\n      },\n      body: JSON.stringify({\n        model: \"\",\n        stream: true,\n        temperature: 0.1,\n      }),\n    }),\n    onAgree() {},\n    onOppose() {},\n  });\n  return () => {\n    dispose();\n  };\n}, [monaco, editor]);\n```\n\nwith the Request params, developer can request custom model service\n\n## Options\n\n| Name     | Type                         | Default | Required | Description              |\n| -------- | ---------------------------- | ------- | -------- | ------------------------ |\n| request  | `Request`                    | -       | ✅       | AI request               |\n| tools    | `(keyof typeof TOOL_TYPE)[]` | -       |          | inbuilt tools            |\n| action   | `Record<string, Action>`     | -       |          | actions                  |\n| duration | `number`                     | 500ms   |          | duration of action bar |\n\n## Types\n\n```ts\nenum TOOL_TYPE {\n  SPEAK = \"SPEAK\",\n  COPY = \"COPY\",\n  AGREE = \"AGREE\",\n  OPPOSE = \"OPPOSE\",\n  REFRESH = \"REFRESH\",\n}\n\ntype Action = {\n  key?: string;\n  title: string;\n  prompt: string;\n  action?: (params: {\n    event: monaco.IMouseEvent;\n    target: monaco.editor.IMouseTarget;\n    [key: string]: unknown;\n  }) => void;\n};\n\nconst defaultAction = {\n  \"code-explanation\": {\n    title: \"代码解释\",\n    prompt: \"请解释这段代码\",\n  },\n  \"code-optimization\": {\n    title: \"代码优化\",\n    prompt: \"请优化这段代码\",\n  },\n  \"code-comment\": {\n    title: \"代码注释\",\n    prompt: \"请给这段代码添加注释\",\n  },\n};\n```\n\n## LICENSE\n\nMIT\n","readmeFilename":"README.md"}