diff --git a/apps/api/pyproject.toml b/apps/api/pyproject.toml index 3ef7755db..955feb071 100644 --- a/apps/api/pyproject.toml +++ b/apps/api/pyproject.toml @@ -37,6 +37,8 @@ dependencies = [ # 請參閱 apps/api/Dockerfile Phase 6.4i 註解 # Phase 9: Agent Teams - Claude Agent SDK "claude-agent-sdk>=0.1.50", + # Sprint 5.1 2026-04-08 Claude Sonnet 4.6: Service Registry YAML 讀取 + "pyyaml>=6.0.0", ] # [tool.uv.sources] diff --git a/packages/shared-types/schemas/api-types.json b/packages/shared-types/schemas/api-types.json index c5436fa34..034157e47 100644 --- a/packages/shared-types/schemas/api-types.json +++ b/packages/shared-types/schemas/api-types.json @@ -1931,6 +1931,26 @@ "description": "人工補充說明", "title": "Notes" }, + "requires_approval_level": { + "default": "auto", + "description": "auto=直接執行, standard=1票, critical=2票MultiSig(由 Service Registry 決定)", + "title": "Requires Approval Level", + "type": "string" + }, + "stateful_targets": { + "description": "此 Playbook 操作的 Stateful 服務清單,對應 service-registry.yaml", + "items": { + "type": "string" + }, + "title": "Stateful Targets", + "type": "array" + }, + "requires_pre_backup": { + "default": false, + "description": "執行前是否需要 Pre-flight 備份檢查", + "title": "Requires Pre Backup", + "type": "boolean" + }, "created_at": { "format": "date-time", "title": "Created At", diff --git a/packages/shared-types/src/api-types.ts b/packages/shared-types/src/api-types.ts index cea269ef5..5c8150d9d 100644 --- a/packages/shared-types/src/api-types.ts +++ b/packages/shared-types/src/api-types.ts @@ -648,6 +648,18 @@ export type Tags = string[]; * 人工補充說明 */ export type Notes = string | null; +/** + * auto=直接執行, standard=1票, critical=2票MultiSig(由 Service Registry 決定) + */ +export type RequiresApprovalLevel = string; +/** + * 此 Playbook 操作的 Stateful 服務清單,對應 service-registry.yaml + */ +export type StatefulTargets = string[]; +/** + * 執行前是否需要 Pre-flight 備份檢查 + */ +export type RequiresPreBackup = boolean; export type CreatedAt6 = string; export type UpdatedAt3 = string; export type SuccessRate = number; @@ -1349,6 +1361,9 @@ export interface Playbook { approved_at?: ApprovedAt; tags?: Tags; notes?: Notes; + requires_approval_level?: RequiresApprovalLevel; + stateful_targets?: StatefulTargets; + requires_pre_backup?: RequiresPreBackup; created_at?: CreatedAt6; updated_at?: UpdatedAt3; [k: string]: unknown;