feat(github-copilot-sdk): add workspace skills support (v0.9.0) (#51)
* feat(github-copilot-sdk): add workspace skills support - Introduce ENABLE_WORKSPACE_SKILLS valve to enable/disable workspace custom tools discovery - Modify _build_session_config() to auto-load tools from .copilot-skills/ directory - Add workspace_skills_example.py template with 3 working example tools - Update README.md and README_CN.md with Workspace Skills guide and usage examples - Create v0.9.0.md and v0.9.0_CN.md release notes - Sync version to all docs files (index.md, index.zh.md, and main docs) - Bump version from 0.8.0 to 0.9.0 across all 7+ locations * docs: establish temp files handling policy (project-based, not /tmp) - Add TEMP_FILES_POLICY.md guideline for all skills and workflows - Update pr-submitter skill to use .temp/ directory instead of /tmp - Update release-prep skill documentation with temp file convention - Add .temp/ and .build/ entries to .gitignore - Create internal policy memo in /memories/repo/ This policy ensures: - All temporary files stay within project workspace (not system /tmp) - Alignment with OpenWebUI workspace isolation principles - Multi-user safety and cleanup traceability - Consistent handling across all skills and development workflows * fix(terminology): rename 'workspace skills' to 'workspace custom tools' for accuracy The term 'Skills' in Anthropic context refers to instruction-based frameworks (SKILL.md files with YAML frontmatter + markdown), not custom tool functions. Our implementation uses @define_tool decorator to define custom tools that the SDK auto-discovers from .copilot-skills/ directory. These are Tools, not Skills. Changes: - Rename ENABLE_WORKSPACE_SKILLS valve -> ENABLE_WORKSPACE_TOOLS - Update all documentation (README, README_CN, docs, release notes) - Fix section headings and descriptions throughout - Ensure consistent terminology across all files This is a terminology-only change; functionality remains identical. * feat(pipes): release v0.9.0 of GitHub Copilot SDK Pipe - Integrated OpenWebUI Skills Bridge and manage_skills tool - Reinforced status bar stability with session_finalized logic - Added persistent SDK config directory support * docs(pipes): add comprehensive guides and v0.9.0 notes for Copilot SDK - Added skill manager and best practices guides - Added publishing tool documentation - Included v0.9.0 release notes and deployment script - Updated usage guides
This commit is contained in:
@@ -0,0 +1,76 @@
|
||||
# 📤 `publish_file_from_workspace` 工具指南
|
||||
|
||||
本文档说明 GitHub Copilot SDK Pipe 内置工具 `publish_file_from_workspace` 的推荐使用规范。
|
||||
|
||||
## 工具用途
|
||||
|
||||
当 Agent 在当前工作区生成文件后,使用此工具可实现:
|
||||
|
||||
- 将文件发布到 OpenWebUI 文件存储。
|
||||
- 返回稳定可用的预览/下载链接。
|
||||
- 在本地磁盘与对象存储后端保持一致交付行为。
|
||||
|
||||
## 必填参数
|
||||
|
||||
- `filename`:工作区内的相对路径文件名。
|
||||
- ✅ 示例:`report.xlsx`
|
||||
- ✅ 示例:`output/summary.html`
|
||||
- ❌ 避免工作区外临时路径(如 `/tmp/...`)。
|
||||
|
||||
## 返回结构(常见字段)
|
||||
|
||||
该工具通常返回用于构建前端链接与渲染的数据:
|
||||
|
||||
- `filename`
|
||||
- `download_url`
|
||||
- `preview_url`(如可预览)
|
||||
- 渲染元数据(HTML 场景可含 `html_embed`)
|
||||
|
||||
## 发布模式
|
||||
|
||||
### 1) `artifacts`(默认)
|
||||
|
||||
- 消息中返回 `[Preview]` + `[Download]`。
|
||||
- 对于 HTML 可预览内容,可在 ```html 代码块中渲染 `html_embed`。
|
||||
- 适用于聊天内联交互式预览。
|
||||
|
||||
### 2) `richui`
|
||||
|
||||
- 消息中返回 `[Preview]` + `[Download]`。
|
||||
- 由 Rich UI 渲染器自动输出集成预览。
|
||||
- 聊天正文中不输出 iframe/html 预览块。
|
||||
|
||||
## PDF 安全规则(强制)
|
||||
|
||||
针对 PDF 文件,必须只输出 Markdown 链接:
|
||||
|
||||
- `[Preview](...)`
|
||||
- `[Download](...)`(可用时)
|
||||
|
||||
禁止使用 iframe 或 HTML 代码块嵌入 PDF。
|
||||
|
||||
## 推荐流程
|
||||
|
||||
1. 在工作区生成文件。
|
||||
2. 调用 `publish_file_from_workspace(filename=...)`。
|
||||
3. 按模式返回链接。
|
||||
4. 若为 `.pdf`,严格执行“仅链接”规则。
|
||||
|
||||
## 示例
|
||||
|
||||
### 示例 A:HTML 报告(artifacts)
|
||||
|
||||
- 发布 `analysis.html`。
|
||||
- 返回链接。
|
||||
- 允许渲染 `html_embed` 进行直接预览。
|
||||
|
||||
### 示例 B:PDF 报告
|
||||
|
||||
- 发布 `audit.pdf`。
|
||||
- 仅返回链接。
|
||||
- 完全跳过 iframe/html 嵌入。
|
||||
|
||||
## 相关文档
|
||||
|
||||
- [manage_skills 工具指南](./SKILLS_MANAGER_CN.md)
|
||||
- [Skills 最佳实践](./SKILLS_BEST_PRACTICES_CN.md)
|
||||
Reference in New Issue
Block a user