{"id":27915172,"url":"https://github.com/cofficlab/example-plugin","last_synced_at":"2026-01-23T00:31:06.871Z","repository":{"id":284505146,"uuid":"955158658","full_name":"CofficLab/example-plugin","owner":"CofficLab","description":null,"archived":false,"fork":false,"pushed_at":"2025-03-26T11:38:26.000Z","size":9,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-05-06T15:50:41.675Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"HTML","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/CofficLab.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2025-03-26T07:44:25.000Z","updated_at":"2025-04-29T03:18:32.000Z","dependencies_parsed_at":"2025-03-26T08:43:48.798Z","dependency_job_id":null,"html_url":"https://github.com/CofficLab/example-plugin","commit_stats":null,"previous_names":["cofficlab/example-plugin"],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/CofficLab/example-plugin","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CofficLab%2Fexample-plugin","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CofficLab%2Fexample-plugin/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CofficLab%2Fexample-plugin/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CofficLab%2Fexample-plugin/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/CofficLab","download_url":"https://codeload.github.com/CofficLab/example-plugin/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CofficLab%2Fexample-plugin/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28676145,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-22T20:48:19.482Z","status":"ssl_error","status_checked_at":"2026-01-22T20:48:14.968Z","response_time":144,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2025-05-06T15:35:35.171Z","updated_at":"2026-01-23T00:31:06.848Z","avatar_url":"https://github.com/CofficLab.png","language":"HTML","funding_links":[],"categories":[],"sub_categories":[],"readme":"# GitOK 示例插件\n\n这是一个用于演示如何开发 GitOK 插件的示例项目。\n\n## 功能\n\n这个示例插件提供了以下功能：\n\n1. **打招呼** - 一个简单的问候动作，展示基本的动作执行方式\n2. **当前时间** - 显示当前时间的自定义视图，演示嵌入式视图\n3. **计算器** - 一个简单的计算器，演示独立窗口视图\n\n## 安装\n\n在 GitOK 应用启动后，此示例插件会自动复制到开发插件目录中，你可以通过搜索框直接使用它提供的功能。\n\n## 开发自己的插件\n\n如果你想基于这个示例开发自己的 GitOK 插件，请遵循以下步骤：\n\n1. 复制示例插件目录作为起点\n\n   ```bash\n   # 示例插件位于用户数据目录的开发插件文件夹中\n   # macOS: ~/Library/Application Support/buddy/plugins/dev/example-plugin\n   # Windows: %APPDATA%\\buddy\\plugins\\dev\\example-plugin\n   # Linux: ~/.config/buddy/plugins/dev/example-plugin\n   ```\n\n2. 修改 `package.json` 中的插件信息\n\n   ```json\n   {\n     \"name\": \"your-plugin-id\",\n     \"version\": \"1.0.0\",\n     \"description\": \"你的插件描述\",\n     \"main\": \"index.js\"\n   }\n   ```\n\n3. 修改 `index.js` 中的插件ID和其他信息\n\n   ```javascript\n   const PLUGIN_ID = 'your-plugin-id';\n\n   const plugin = {\n     id: PLUGIN_ID,\n     name: '你的插件名称',\n     description: '你的插件描述',\n     // ...\n   };\n   ```\n\n4. 自定义插件动作\n\n   - 在 `getActions` 函数中定义你的动作\n   - 在 `executeAction` 函数中实现动作逻辑\n   - 如有必要，在 `views` 目录中创建自定义视图HTML文件\n\n5. 测试你的插件\n   - 确保你的插件在正确的开发目录中\n   - 重启 GitOK 应用\n   - 在搜索框中查找你的插件动作\n\n## 插件开发指南\n\n### 插件接口\n\n每个 GitOK 插件必须实现以下接口：\n\n```typescript\ninterface Plugin {\n  id: string; // 插件唯一ID\n  name: string; // 插件名称\n  description: string; // 插件描述\n  version: string; // 插件版本\n  author: string; // 插件作者\n\n  getActions(keyword?: string): Promise\u003cAction[]\u003e; // 获取插件动作\n  executeAction(action: Action): Promise\u003cany\u003e; // 执行动作\n  getViewContent?(viewPath: string): Promise\u003cstring\u003e; // 获取视图HTML (可选)\n}\n```\n\n### 动作定义\n\n每个动作应包含以下字段：\n\n```typescript\ninterface Action {\n  id: string; // 动作唯一ID (格式: 'plugin-id:action-name')\n  title: string; // 动作标题\n  description: string; // 动作描述\n  icon: string; // 动作图标 (可使用Emoji)\n  plugin: string; // 插件ID\n  viewPath?: string; // 视图路径 (可选)\n  viewMode?: 'embedded' | 'window'; // 视图模式 (可选)\n}\n```\n\n### 视图开发\n\nHTML视图文件应遵循以下最佳实践：\n\n1. 使用标准HTML5结构\n2. 确保样式隔离，避免影响主应用\n3. 使用内联CSS样式\n4. 使用内联JavaScript，不要依赖外部库\n5. 避免使用敏感API，如`eval`\n\n有关更多信息，请参考完整的 GitOK 插件开发文档。\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcofficlab%2Fexample-plugin","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcofficlab%2Fexample-plugin","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcofficlab%2Fexample-plugin/lists"}