{"_id":"@astii/monaco-copilot","_rev":"5-30eb0865bad31d7f863f4dcb2f8f0b23","name":"@astii/monaco-copilot","dist-tags":{"latest":"0.0.5"},"versions":{"0.0.1":{"name":"@astii/monaco-copilot","version":"0.0.1","keywords":["monaco-editor","copilot","AI"],"license":"MIT","_id":"@astii/monaco-copilot@0.0.1","maintainers":[{"name":"tangxiaoxin","email":"1302947749@qq.com"}],"dist":{"shasum":"132720f25d665b3e4c0930938708d51601b35151","tarball":"https://registry.npmjs.org/@astii/monaco-copilot/-/monaco-copilot-0.0.1.tgz","fileCount":38,"integrity":"sha512-dsVUSov6NCRCUUqb5TXcIddY+F7aufWk0L35Q4rZ/Q8niT0RLNWc4pJnbLOSdzkwDaogTXJwEguM9M0LDNLHiQ==","signatures":[{"sig":"MEUCIQCI9pKERYRAbZS3UAv5dd3OOR2o8506YGjbqZbpcnll8wIgP6pHyRzRsTxX0azd2fVW9BgTMjUs4LEnFySp2DuC6oY=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":110485},"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 code copilot","directories":{},"_nodeVersion":"18.19.0","publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"father":"^4.5.0"},"_npmOperationalInternal":{"tmp":"tmp/monaco-copilot_0.0.1_1734080181558_0.9374334750659823","host":"s3://npm-registry-packages-npm-production"}},"0.0.2":{"name":"@astii/monaco-copilot","version":"0.0.2","keywords":["monaco-editor","copilot","AI"],"license":"MIT","_id":"@astii/monaco-copilot@0.0.2","maintainers":[{"name":"tangxiaoxin","email":"1302947749@qq.com"}],"dist":{"shasum":"7c5994dc2751a44b81139ae277e68805e14b11e6","tarball":"https://registry.npmjs.org/@astii/monaco-copilot/-/monaco-copilot-0.0.2.tgz","fileCount":38,"integrity":"sha512-obl6FufGSPzbcvYJIyVgGVYfGSNN24kEng7WeKAOVjfvSzHT2kdBe8Lsub6L6sJX3dn91TvVJ9Dn+3ltIn9wsA==","signatures":[{"sig":"MEQCIG6ZWscInWloNQb+Aj4u+ZvSVfX+aM3c9BrZj2iu0j9LAiAdnMPLR1RWXuRhr6RHN6QSAvGxO1mwZZ5SW+o7sad4Vw==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":130910},"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 code copilot","directories":{},"_nodeVersion":"18.19.0","publishConfig":{"access":"public","registry":"https://registry.npmjs.org"},"_hasShrinkwrap":false,"devDependencies":{"father":"^4.5.0"},"_npmOperationalInternal":{"tmp":"tmp/monaco-copilot_0.0.2_1735893655327_0.5082652663119183","host":"s3://npm-registry-packages-npm-production"}},"0.0.3":{"name":"@astii/monaco-copilot","version":"0.0.3","keywords":["monaco-editor","copilot","AI"],"license":"MIT","_id":"@astii/monaco-copilot@0.0.3","maintainers":[{"name":"tangxiaoxin","email":"1302947749@qq.com"}],"dist":{"shasum":"8d5ffd17b8e8799d9ba60b90197a5c32126d459d","tarball":"https://registry.npmjs.org/@astii/monaco-copilot/-/monaco-copilot-0.0.3.tgz","fileCount":38,"integrity":"sha512-LZYdtzeZz8/FujtEk7mAVZfdkWiOTzoEdRxmxBs6gryrGrd3Rdpz2gH+KDQmFQIOJQT0RhVFro9qcBnQC/8WdA==","signatures":[{"sig":"MEUCIQCpjNpLYdkdBQBeT5mmG2rLGlp0XTFC2okYImh4RgfOqQIgCyYL/5BbbkkKQP1kE3Jxqxzd/AbtNzJKyG/6X1oZtVk=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":130956},"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 code copilot","directories":{},"_nodeVersion":"18.19.0","publishConfig":{"access":"public","registry":"https://registry.npmjs.org"},"_hasShrinkwrap":false,"devDependencies":{"father":"^4.5.0"},"_npmOperationalInternal":{"tmp":"tmp/monaco-copilot_0.0.3_1741851675957_0.1385454229159424","host":"s3://npm-registry-packages-npm-production"}},"0.0.4":{"name":"@astii/monaco-copilot","version":"0.0.4","keywords":["monaco-editor","copilot","AI"],"license":"MIT","_id":"@astii/monaco-copilot@0.0.4","maintainers":[{"name":"tangxiaoxin","email":"1302947749@qq.com"}],"dist":{"shasum":"73f637220878ed88421fb5c9e395fb3aa6a0b713","tarball":"https://registry.npmjs.org/@astii/monaco-copilot/-/monaco-copilot-0.0.4.tgz","fileCount":38,"integrity":"sha512-6zVq8id3kJqIoTilluGvvIRiHcnuSL3UyFB5x/s7Ts7LWneANA1SOZmbmIz82Z+1ZWfo66oKi7swj5I8VkKpdw==","signatures":[{"sig":"MEYCIQCGAHWAXkDY9uhlW9kWAdJBElJssQeTRAsy6xwvow3PUgIhANtLFaG+qcN3nFLuKLpfbrcOZR/rH70H/zCMP+ZffKqj","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":131810},"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 code copilot","directories":{},"_nodeVersion":"18.19.0","publishConfig":{"access":"public","registry":"https://registry.npmjs.org"},"_hasShrinkwrap":false,"devDependencies":{"father":"^4.5.0"},"_npmOperationalInternal":{"tmp":"tmp/monaco-copilot_0.0.4_1742216447216_0.11836131694925078","host":"s3://npm-registry-packages-npm-production"}},"0.0.5":{"name":"@astii/monaco-copilot","version":"0.0.5","description":"monaco-editor code copilot","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","copilot","AI"],"authors":["1302947749@qq.com"],"license":"MIT","publishConfig":{"access":"public","registry":"https://registry.npmjs.org"},"devDependencies":{"father":"^4.5.0"},"_id":"@astii/monaco-copilot@0.0.5","gitHead":"4edc4f4232c8750b0c695dbdee609b20996f8ca1","_nodeVersion":"18.20.0","_npmVersion":"10.5.0","dist":{"integrity":"sha512-L0eXiXlPFbwFbYGvtUhEuekBvclLWNtnrepX8523q1NNB3UZZYWZnKH8Ey0kwZRKqxpvqxvN5tEf5GFx04dYug==","shasum":"d702c49ea602982dc12534e693ddb381871c635c","tarball":"https://registry.npmjs.org/@astii/monaco-copilot/-/monaco-copilot-0.0.5.tgz","fileCount":38,"unpackedSize":132417,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEYCIQDDy0HnCj7ssBu7DPElj5svGBTD+fspy0N+bd+b7uCXaAIhALjaGJMxrX2QH0enSjGLQc0viQ2+uOByaLm/cou+DKgT"}]},"_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-copilot_0.0.5_1744104907374_0.46005026564485796"},"_hasShrinkwrap":false}},"time":{"created":"2024-12-13T08:56:21.400Z","modified":"2025-04-08T09:35:07.742Z","0.0.1":"2024-12-13T08:56:21.755Z","0.0.2":"2025-01-03T08:40:55.525Z","0.0.3":"2025-03-13T07:41:16.155Z","0.0.4":"2025-03-17T13:00:47.386Z","0.0.5":"2025-04-08T09:35:07.559Z"},"license":"MIT","keywords":["monaco-editor","copilot","AI"],"description":"monaco-editor code copilot","maintainers":[{"name":"tangxiaoxin","email":"1302947749@qq.com"}],"readme":"# @astii/monaco-copilot\n\n[![NPM version](https://img.shields.io/npm/v/@astii/monaco-copilot.svg?style=flat)](https://npmjs.com/package/@astii/monaco-copilot)\n[![NPM downloads](http://img.shields.io/npm/dm/@astii/monaco-copilot.svg?style=flat)](https://npmjs.com/package/@astii/monaco-copilot)\n\nmonaco-editor code completions tool with AI power\n\n![shot](https://p4-ec.eckwai.com/kos/nlav12333/monaco/copilot.gif)\n\n## Install\n\n```bash\n$ npm install @astii/monaco-copilot\n```\n\n## Usage\n\n```ts\nimport { registerCopilot } from \"@astii/monaco-copilot\";\n\nuseEffect(() => {\n  if (!monaco || !editor) return;\n  const dispose = registerCopilot(monaco, editor, {\n    language: \"typescript\",\n    request: new Request(\"AI model service\", {\n      method: \"POST\",\n      headers: {\n        \"x-dmo-provider\": \"model name\",\n        \"x-dmo-username\": \"username\",\n        authorization: \"auth\",\n        \"Content-Type\": \"application/json\",\n      },\n      body: JSON.stringify({\n        //custom params\n      }),\n    }),\n    getCompletions(res) {\n      //custom response resolver\n    },\n    onAcceptCompletion(params) {\n      console.log(\"accept\", params);\n    },\n    onFreeCompletion(params) {\n      console.log(\"free\", params);\n    },\n  });\n  return () => {\n    dispose();\n  };\n}, [monaco, editor]);\n```\n\n## Options\n\n| Name               | Type                                           | Default | Required | Description              |\n| ------------------ | ---------------------------------------------- | ------- | -------- | ------------------------ |\n| request            | `Request`                                      | -       | ✅       | AI Request               |\n| getCompletions     | `(res: Response) => Promise<CompletionItem[]>` | -       |          | custom response resolver |\n| onAcceptCompletion | `(params: CompletionItem) => void`             | -       |          | accept completion        |\n| onFreeCompletion   | `(params: CompletionItem) => void`             | -       |          | free completion          |\n\n## LICENSE\n\nMIT\n","readmeFilename":"README.md"}