mirror of
https://github.com/turnstonelabs/turnstone.git
synced 2026-08-12 23:12:23 -06:00
dc464ac313
Brings skills implementation into full compliance with agentskills.io: Parser: - Read `allowed-tools` (hyphenated, standard) only; stored as `allowed_tools` internally — no underscore fallback - Reject consecutive hyphens in skill names - Extract author/version from standard `metadata:` map with top-level fallback; null-safe (no "None" string for bare YAML keys) - Truncate description at 1024 chars, compatibility at 500 chars (spec caps) with log warnings - Lenient parsing mode (lenient=True) for cross-client import: sanitizes names, returns None on skip, malformed-YAML colon-value retry - Type overloads: strict mode returns ParsedSkill, lenient returns ParsedSkill | None Session: - `<available-skills>` XML catalog in system messages for activation="search" skills (disabled ones filtered out, capped at 30) Tool rename: - `load_skill` tool → `skill` (JSON, session preparers/executors, approval labels, tests, docs) Storage (migration 023): - Add `license` and `compatibility` columns to prompt_templates - skill_license / compatibility params on create_prompt_template across protocol, SQLite, PostgreSQL backends - Add to SKILL_MUTABLE for update_prompt_template API + server: - SkillInfo, CreateSkillRequest, UpdateSkillRequest: license + compatibility fields - Create/update/install endpoints extract and persist both fields - Install endpoint maps parsed.license + parsed.compatibility from imported SKILL.md (previously discarded) - _skill_to_response() includes both fields Admin UI: - Create + edit modals: version, license, compatibility fields - Readonly (imported) skills: "edit" → "view" button, modal title "View Skill", all fields disabled, Save hidden, Cancel → "Close", collapsibles auto-expand, focus on Close button - :disabled CSS for dark-theme modal inputs (bg-highlight, cursor not-allowed, dimmed text) - Fix addEventListener stacking on auto-approve checkboxes → .onchange SDK: license + compatibility on SkillInfo, CreateSkillRequest, UpdateSkillRequest TypeScript interfaces Docs: governance.md, judge.md, tools.md, README, diagram updated
101 lines
3.2 KiB
Plaintext
101 lines
3.2 KiB
Plaintext
@startuml
|
|
!include https://raw.githubusercontent.com/plantuml-stdlib/C4-PlantUML/master/C4_Component.puml
|
|
LAYOUT_LEFT_RIGHT()
|
|
|
|
title Skills Discovery & Runtime Architecture
|
|
|
|
skinparam backgroundColor #1e1e2e
|
|
skinparam defaultFontColor #cdd6f4
|
|
skinparam defaultFontName "JetBrains Mono"
|
|
skinparam arrowColor #89b4fa
|
|
skinparam rectangleBorderColor #585b70
|
|
skinparam rectangleBackgroundColor #313244
|
|
skinparam noteBorderColor #585b70
|
|
skinparam noteBackgroundColor #45475a
|
|
skinparam packageBorderColor #585b70
|
|
|
|
package "External Sources" as ext #181825 {
|
|
rectangle "skills.sh\nRegistry" as skillssh
|
|
rectangle "GitHub\nRepositories" as github
|
|
}
|
|
|
|
package "Console Server" as console #181825 {
|
|
rectangle "admin_skill_discover\nGET /v1/api/admin/skills/discover" as discover
|
|
rectangle "admin_skill_install\nPOST /v1/api/admin/skills/install" as install
|
|
rectangle "_get_discovery_url\nsettings fallback" as settings
|
|
}
|
|
|
|
package "Core Modules" as core #181825 {
|
|
rectangle "SkillsShClient\nskill_sources.py" as client
|
|
rectangle "fetch_skill_from_github\nskill_sources.py" as fetcher
|
|
rectangle "parse_skill_md\nskill_parser.py" as parser
|
|
rectangle "scan_skill_content\nstorage/_utils.py" as scanner
|
|
}
|
|
|
|
package "Session Runtime" as runtime #181825 {
|
|
rectangle "skill tool\nsession.py" as loadtool
|
|
rectangle "set_skill()\nsession.py" as setskill
|
|
rectangle "_load_skills()\nsession.py" as loadskills
|
|
}
|
|
|
|
package "Storage" as storage #181825 {
|
|
rectangle "prompt_templates\n(skills)" as skills_table
|
|
rectangle "skill_resources\n(bundled files)" as resources_table
|
|
rectangle "system_settings\n(discovery_url)" as settings_table
|
|
}
|
|
|
|
package "Admin UI" as ui #181825 {
|
|
rectangle "Skills Tab\nInstalled / Discover pill" as pill
|
|
rectangle "Discovery View\nsearch + cards" as discoverui
|
|
rectangle "GitHub Import\nmodal" as importui
|
|
}
|
|
|
|
' External discovery flow
|
|
discover --> settings : resolve URL
|
|
settings --> settings_table : DB -> config -> default
|
|
discover --> client : search(query)
|
|
client --> skillssh : GET /api/search
|
|
|
|
install --> client : resolve_github_url()
|
|
client --> skillssh : GET /api/skills/{id}
|
|
install --> fetcher : fetch SKILL.md + resources
|
|
fetcher --> github : raw.githubusercontent.com
|
|
fetcher --> github : api.github.com/git/trees
|
|
fetcher --> parser : parse frontmatter
|
|
install --> scanner : auto-scan on create
|
|
install --> skills_table : create_prompt_template
|
|
install --> resources_table : create_skill_resource
|
|
|
|
' Runtime skill loading flow
|
|
loadtool --> skills_table : search (BM25 ranking)
|
|
loadtool --> setskill : load (name)
|
|
setskill --> loadskills : reload + reinit system messages
|
|
loadskills --> skills_table : get_skill_by_name
|
|
|
|
' UI flow
|
|
pill --> discoverui : switch view
|
|
discoverui --> discover : authFetch()
|
|
importui --> install : POST (github source)
|
|
|
|
' Annotations
|
|
note right of parser
|
|
YAML frontmatter -> ParsedSkill
|
|
allowed-tools (standard) -> allowed_tools (internal)
|
|
Anthropic + Hermes tag formats
|
|
Name validation (lowercase+hyphens)
|
|
end note
|
|
|
|
note right of loadtool
|
|
search: auto-approved (read-only)
|
|
load: requires user approval
|
|
Main session only (no sub-agents)
|
|
end note
|
|
|
|
note right of scanner
|
|
4 risk axes (content, supply chain,
|
|
vulnerability, capability)
|
|
Auto-triggers on create/update
|
|
end note
|
|
|
|
@enduml
|