Files
ai-app-ops-tools/templates/service.yaml
T
huty dc2d2acc82 feat: initial framework for AI-powered ops terminal
Scaffold an MVP of the natural-language ops terminal: inventory + intent
template registry, SSH/WinRM/local connectors, risk-gated executor with
SQLite audit log, Claude-driven agent layer using Function Calling, plus a
Typer CLI and FastAPI surface.

Includes 10 cross-OS intents (disk/system/service) and example inventory.
Verified end-to-end on the local Windows host: hosts/intents listing,
check_disk_usage execution, and WRITE-class confirmation gating.

Co-Authored-By: Claude Opus 4 <noreply@anthropic.com>
2026-05-21 11:01:43 +09:00

54 lines
1.4 KiB
YAML

# 服务管理意图(含 WRITE 类,需确认后才会执行)
intents:
- intent: check_service_status
description: 查看服务当前状态
risk_level: READ
params:
- name: service
type: string
required: true
implementations:
linux:
command: "systemctl status {{service}} --no-pager || service {{service}} status"
windows:
command: "Get-Service -Name '{{service}}' | Select-Object Name,Status,StartType | ConvertTo-Json"
- intent: restart_service
description: 重启指定服务
risk_level: WRITE
params:
- name: service
type: string
required: true
implementations:
linux:
command: "sudo systemctl restart {{service}}"
windows:
command: "Restart-Service -Name '{{service}}' -Force"
- intent: stop_service
description: 停止指定服务
risk_level: WRITE
params:
- name: service
type: string
required: true
implementations:
linux:
command: "sudo systemctl stop {{service}}"
windows:
command: "Stop-Service -Name '{{service}}' -Force"
- intent: start_service
description: 启动指定服务
risk_level: WRITE
params:
- name: service
type: string
required: true
implementations:
linux:
command: "sudo systemctl start {{service}}"
windows:
command: "Start-Service -Name '{{service}}'"