@smilintux/skcapstone 0.3.1 → 0.3.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/docs/CUSTOM_AGENT.md +184 -0
- package/docs/GETTING_STARTED.md +3 -0
- package/package.json +1 -1
- package/scripts/archive-sessions.sh +72 -0
- package/scripts/nvidia-proxy.mjs +79 -15
- package/scripts/telegram-catchup-all.sh +136 -0
- package/src/skcapstone/blueprints/builtins/itil-operations.yaml +40 -0
- package/src/skcapstone/cli/__init__.py +2 -0
- package/src/skcapstone/cli/itil.py +434 -0
- package/src/skcapstone/coordination.py +1 -0
- package/src/skcapstone/itil.py +1104 -0
- package/src/skcapstone/mcp_server.py +258 -0
- package/src/skcapstone/mcp_tools/__init__.py +2 -0
- package/src/skcapstone/mcp_tools/gtd_tools.py +1 -1
- package/src/skcapstone/mcp_tools/itil_tools.py +657 -0
- package/src/skcapstone/scheduled_tasks.py +62 -0
- package/src/skcapstone/service_health.py +81 -2
|
@@ -55,6 +55,16 @@ Tools:
|
|
|
55
55
|
kms_list_keys — List all KMS keys
|
|
56
56
|
kms_rotate — Rotate a KMS key
|
|
57
57
|
model_route — Route task to optimal model tier/name
|
|
58
|
+
itil_incident_create — Create ITIL incident
|
|
59
|
+
itil_incident_update — Update incident status/severity
|
|
60
|
+
itil_incident_list — List/filter incidents
|
|
61
|
+
itil_problem_create — Create problem record
|
|
62
|
+
itil_problem_update — Update problem/root cause
|
|
63
|
+
itil_change_propose — Propose change (RFC)
|
|
64
|
+
itil_change_update — Update change status
|
|
65
|
+
itil_cab_vote — Submit CAB vote
|
|
66
|
+
itil_status — ITIL dashboard
|
|
67
|
+
itil_kedb_search — Search Known Error Database
|
|
58
68
|
|
|
59
69
|
Invocation (all equivalent):
|
|
60
70
|
skcapstone mcp serve # CLI entry point
|
|
@@ -2470,6 +2480,180 @@ async def list_tools() -> list[Tool]:
|
|
|
2470
2480
|
"required": ["name"],
|
|
2471
2481
|
},
|
|
2472
2482
|
),
|
|
2483
|
+
# ── ITIL Service Management ─────────────────────────────
|
|
2484
|
+
Tool(
|
|
2485
|
+
name="itil_incident_create",
|
|
2486
|
+
description=(
|
|
2487
|
+
"Create a new ITIL incident for a service disruption. "
|
|
2488
|
+
"Auto-creates a linked GTD item (next-action for sev1/sev2, inbox for sev3/sev4)."
|
|
2489
|
+
),
|
|
2490
|
+
inputSchema={
|
|
2491
|
+
"type": "object",
|
|
2492
|
+
"properties": {
|
|
2493
|
+
"title": {"type": "string", "description": "Brief description of the incident"},
|
|
2494
|
+
"severity": {"type": "string", "enum": ["sev1", "sev2", "sev3", "sev4"], "description": "Severity level (default: sev3)"},
|
|
2495
|
+
"source": {"type": "string", "enum": ["service_health", "dreaming", "manual", "daemon_error", "heartbeat"], "description": "Detection source (default: manual)"},
|
|
2496
|
+
"affected_services": {"type": "array", "items": {"type": "string"}, "description": "List of affected service names"},
|
|
2497
|
+
"impact": {"type": "string", "description": "Business impact description"},
|
|
2498
|
+
"managed_by": {"type": "string", "description": "Agent responsible for managing this incident"},
|
|
2499
|
+
"tags": {"type": "array", "items": {"type": "string"}, "description": "Tags for categorization"},
|
|
2500
|
+
},
|
|
2501
|
+
"required": ["title"],
|
|
2502
|
+
},
|
|
2503
|
+
),
|
|
2504
|
+
Tool(
|
|
2505
|
+
name="itil_incident_update",
|
|
2506
|
+
description=(
|
|
2507
|
+
"Update an incident: transition status, escalate severity, "
|
|
2508
|
+
"add timeline notes, or resolve. Valid status transitions: "
|
|
2509
|
+
"detected->acknowledged->investigating->resolved->closed."
|
|
2510
|
+
),
|
|
2511
|
+
inputSchema={
|
|
2512
|
+
"type": "object",
|
|
2513
|
+
"properties": {
|
|
2514
|
+
"incident_id": {"type": "string", "description": "Incident ID (e.g. inc-a1b2c3d4)"},
|
|
2515
|
+
"agent": {"type": "string", "description": "Agent making the update"},
|
|
2516
|
+
"new_status": {"type": "string", "enum": ["acknowledged", "investigating", "escalated", "resolved", "closed"], "description": "New status"},
|
|
2517
|
+
"severity": {"type": "string", "enum": ["sev1", "sev2", "sev3", "sev4"], "description": "New severity"},
|
|
2518
|
+
"note": {"type": "string", "description": "Timeline note"},
|
|
2519
|
+
"resolution_summary": {"type": "string", "description": "Resolution summary (when resolving)"},
|
|
2520
|
+
"related_problem_id": {"type": "string", "description": "Link to a related problem record"},
|
|
2521
|
+
},
|
|
2522
|
+
"required": ["incident_id", "agent"],
|
|
2523
|
+
},
|
|
2524
|
+
),
|
|
2525
|
+
Tool(
|
|
2526
|
+
name="itil_incident_list",
|
|
2527
|
+
description="List ITIL incidents filtered by status, severity, or affected service.",
|
|
2528
|
+
inputSchema={
|
|
2529
|
+
"type": "object",
|
|
2530
|
+
"properties": {
|
|
2531
|
+
"status": {"type": "string", "enum": ["detected", "acknowledged", "investigating", "escalated", "resolved", "closed"], "description": "Filter by status"},
|
|
2532
|
+
"severity": {"type": "string", "enum": ["sev1", "sev2", "sev3", "sev4"], "description": "Filter by severity"},
|
|
2533
|
+
"service": {"type": "string", "description": "Filter by affected service name"},
|
|
2534
|
+
},
|
|
2535
|
+
"required": [],
|
|
2536
|
+
},
|
|
2537
|
+
),
|
|
2538
|
+
Tool(
|
|
2539
|
+
name="itil_problem_create",
|
|
2540
|
+
description=(
|
|
2541
|
+
"Create a new ITIL problem record to investigate root cause. "
|
|
2542
|
+
"Links to related incidents and auto-creates a GTD project."
|
|
2543
|
+
),
|
|
2544
|
+
inputSchema={
|
|
2545
|
+
"type": "object",
|
|
2546
|
+
"properties": {
|
|
2547
|
+
"title": {"type": "string", "description": "Problem title"},
|
|
2548
|
+
"managed_by": {"type": "string", "description": "Agent responsible for investigation"},
|
|
2549
|
+
"related_incident_ids": {"type": "array", "items": {"type": "string"}, "description": "Related incident IDs"},
|
|
2550
|
+
"workaround": {"type": "string", "description": "Known workaround if any"},
|
|
2551
|
+
"tags": {"type": "array", "items": {"type": "string"}, "description": "Tags for categorization"},
|
|
2552
|
+
},
|
|
2553
|
+
"required": ["title"],
|
|
2554
|
+
},
|
|
2555
|
+
),
|
|
2556
|
+
Tool(
|
|
2557
|
+
name="itil_problem_update",
|
|
2558
|
+
description=(
|
|
2559
|
+
"Update a problem record: transition status, set root cause, "
|
|
2560
|
+
"add workaround, optionally create a KEDB entry. "
|
|
2561
|
+
"Valid transitions: identified->analyzing->known_error->resolved."
|
|
2562
|
+
),
|
|
2563
|
+
inputSchema={
|
|
2564
|
+
"type": "object",
|
|
2565
|
+
"properties": {
|
|
2566
|
+
"problem_id": {"type": "string", "description": "Problem ID (e.g. prb-e5f6g7h8)"},
|
|
2567
|
+
"agent": {"type": "string", "description": "Agent making the update"},
|
|
2568
|
+
"new_status": {"type": "string", "enum": ["analyzing", "known_error", "resolved"], "description": "New status"},
|
|
2569
|
+
"root_cause": {"type": "string", "description": "Root cause description"},
|
|
2570
|
+
"workaround": {"type": "string", "description": "Workaround description"},
|
|
2571
|
+
"note": {"type": "string", "description": "Timeline note"},
|
|
2572
|
+
"create_kedb": {"type": "boolean", "description": "Create a KEDB entry from this problem"},
|
|
2573
|
+
},
|
|
2574
|
+
"required": ["problem_id", "agent"],
|
|
2575
|
+
},
|
|
2576
|
+
),
|
|
2577
|
+
Tool(
|
|
2578
|
+
name="itil_change_propose",
|
|
2579
|
+
description=(
|
|
2580
|
+
"Propose a change (RFC). Standard changes auto-approve. "
|
|
2581
|
+
"Normal changes require CAB approval. Emergency changes have a "
|
|
2582
|
+
"15-min timeout before auto-approval."
|
|
2583
|
+
),
|
|
2584
|
+
inputSchema={
|
|
2585
|
+
"type": "object",
|
|
2586
|
+
"properties": {
|
|
2587
|
+
"title": {"type": "string", "description": "Change title"},
|
|
2588
|
+
"change_type": {"type": "string", "enum": ["standard", "normal", "emergency"], "description": "Type of change (default: normal)"},
|
|
2589
|
+
"risk": {"type": "string", "enum": ["low", "medium", "high"], "description": "Risk level (default: medium)"},
|
|
2590
|
+
"rollback_plan": {"type": "string", "description": "How to roll back if the change fails"},
|
|
2591
|
+
"test_plan": {"type": "string", "description": "How to verify the change works"},
|
|
2592
|
+
"managed_by": {"type": "string", "description": "Agent managing the change"},
|
|
2593
|
+
"implementer": {"type": "string", "description": "Agent who will implement the change"},
|
|
2594
|
+
"related_problem_id": {"type": "string", "description": "Related problem ID if applicable"},
|
|
2595
|
+
"tags": {"type": "array", "items": {"type": "string"}, "description": "Tags for categorization"},
|
|
2596
|
+
},
|
|
2597
|
+
"required": ["title"],
|
|
2598
|
+
},
|
|
2599
|
+
),
|
|
2600
|
+
Tool(
|
|
2601
|
+
name="itil_change_update",
|
|
2602
|
+
description=(
|
|
2603
|
+
"Update a change: transition status (implementing, deployed, "
|
|
2604
|
+
"verified, failed, closed) or add timeline notes."
|
|
2605
|
+
),
|
|
2606
|
+
inputSchema={
|
|
2607
|
+
"type": "object",
|
|
2608
|
+
"properties": {
|
|
2609
|
+
"change_id": {"type": "string", "description": "Change ID (e.g. chg-i1j2k3l4)"},
|
|
2610
|
+
"agent": {"type": "string", "description": "Agent making the update"},
|
|
2611
|
+
"new_status": {"type": "string", "enum": ["reviewing", "approved", "rejected", "implementing", "deployed", "verified", "failed", "closed"], "description": "New status"},
|
|
2612
|
+
"note": {"type": "string", "description": "Timeline note"},
|
|
2613
|
+
},
|
|
2614
|
+
"required": ["change_id", "agent"],
|
|
2615
|
+
},
|
|
2616
|
+
),
|
|
2617
|
+
Tool(
|
|
2618
|
+
name="itil_cab_vote",
|
|
2619
|
+
description=(
|
|
2620
|
+
"Submit a CAB (Change Advisory Board) vote for a proposed change. "
|
|
2621
|
+
"Each agent writes its own vote file (conflict-free). "
|
|
2622
|
+
"A human rejection blocks the change; a human approval unblocks it."
|
|
2623
|
+
),
|
|
2624
|
+
inputSchema={
|
|
2625
|
+
"type": "object",
|
|
2626
|
+
"properties": {
|
|
2627
|
+
"change_id": {"type": "string", "description": "Change ID to vote on"},
|
|
2628
|
+
"agent": {"type": "string", "description": "Voting agent name"},
|
|
2629
|
+
"decision": {"type": "string", "enum": ["approved", "rejected", "abstain"], "description": "Vote decision (default: abstain)"},
|
|
2630
|
+
"conditions": {"type": "string", "description": "Conditions for approval"},
|
|
2631
|
+
},
|
|
2632
|
+
"required": ["change_id", "agent"],
|
|
2633
|
+
},
|
|
2634
|
+
),
|
|
2635
|
+
Tool(
|
|
2636
|
+
name="itil_status",
|
|
2637
|
+
description=(
|
|
2638
|
+
"ITIL dashboard: open incidents by severity, active problems, "
|
|
2639
|
+
"pending changes, and KEDB count."
|
|
2640
|
+
),
|
|
2641
|
+
inputSchema={"type": "object", "properties": {}, "required": []},
|
|
2642
|
+
),
|
|
2643
|
+
Tool(
|
|
2644
|
+
name="itil_kedb_search",
|
|
2645
|
+
description=(
|
|
2646
|
+
"Search the Known Error Database by symptoms, service name, "
|
|
2647
|
+
"or keywords. Returns matching entries with workarounds."
|
|
2648
|
+
),
|
|
2649
|
+
inputSchema={
|
|
2650
|
+
"type": "object",
|
|
2651
|
+
"properties": {
|
|
2652
|
+
"query": {"type": "string", "description": "Search query (matches title, symptoms, root cause, tags)"},
|
|
2653
|
+
},
|
|
2654
|
+
"required": ["query"],
|
|
2655
|
+
},
|
|
2656
|
+
),
|
|
2473
2657
|
]
|
|
2474
2658
|
|
|
2475
2659
|
|
|
@@ -2618,6 +2802,17 @@ async def call_tool(name: str, arguments: dict) -> list[TextContent]:
|
|
|
2618
2802
|
# Soul Blueprint Registry
|
|
2619
2803
|
"soul_registry_search": _handle_soul_registry_search,
|
|
2620
2804
|
"soul_registry_publish": _handle_soul_registry_publish,
|
|
2805
|
+
# ITIL Service Management
|
|
2806
|
+
"itil_incident_create": _handle_itil_incident_create,
|
|
2807
|
+
"itil_incident_update": _handle_itil_incident_update,
|
|
2808
|
+
"itil_incident_list": _handle_itil_incident_list,
|
|
2809
|
+
"itil_problem_create": _handle_itil_problem_create,
|
|
2810
|
+
"itil_problem_update": _handle_itil_problem_update,
|
|
2811
|
+
"itil_change_propose": _handle_itil_change_propose,
|
|
2812
|
+
"itil_change_update": _handle_itil_change_update,
|
|
2813
|
+
"itil_cab_vote": _handle_itil_cab_vote,
|
|
2814
|
+
"itil_status": _handle_itil_status,
|
|
2815
|
+
"itil_kedb_search": _handle_itil_kedb_search,
|
|
2621
2816
|
}
|
|
2622
2817
|
handler = handlers.get(name)
|
|
2623
2818
|
if handler is None:
|
|
@@ -4679,6 +4874,69 @@ async def _handle_soul_registry_publish(args: dict) -> list[TextContent]:
|
|
|
4679
4874
|
return _error_response(f"Registry publish failed: {exc}")
|
|
4680
4875
|
|
|
4681
4876
|
|
|
4877
|
+
# ── ITIL handlers ─────────────────────────────────────────
|
|
4878
|
+
|
|
4879
|
+
|
|
4880
|
+
async def _handle_itil_incident_create(args: dict) -> list[TextContent]:
|
|
4881
|
+
"""Create a new ITIL incident."""
|
|
4882
|
+
from .mcp_tools.itil_tools import _handle_itil_incident_create as _impl
|
|
4883
|
+
return await _impl(args)
|
|
4884
|
+
|
|
4885
|
+
|
|
4886
|
+
async def _handle_itil_incident_update(args: dict) -> list[TextContent]:
|
|
4887
|
+
"""Update an ITIL incident."""
|
|
4888
|
+
from .mcp_tools.itil_tools import _handle_itil_incident_update as _impl
|
|
4889
|
+
return await _impl(args)
|
|
4890
|
+
|
|
4891
|
+
|
|
4892
|
+
async def _handle_itil_incident_list(args: dict) -> list[TextContent]:
|
|
4893
|
+
"""List ITIL incidents."""
|
|
4894
|
+
from .mcp_tools.itil_tools import _handle_itil_incident_list as _impl
|
|
4895
|
+
return await _impl(args)
|
|
4896
|
+
|
|
4897
|
+
|
|
4898
|
+
async def _handle_itil_problem_create(args: dict) -> list[TextContent]:
|
|
4899
|
+
"""Create a new ITIL problem."""
|
|
4900
|
+
from .mcp_tools.itil_tools import _handle_itil_problem_create as _impl
|
|
4901
|
+
return await _impl(args)
|
|
4902
|
+
|
|
4903
|
+
|
|
4904
|
+
async def _handle_itil_problem_update(args: dict) -> list[TextContent]:
|
|
4905
|
+
"""Update an ITIL problem."""
|
|
4906
|
+
from .mcp_tools.itil_tools import _handle_itil_problem_update as _impl
|
|
4907
|
+
return await _impl(args)
|
|
4908
|
+
|
|
4909
|
+
|
|
4910
|
+
async def _handle_itil_change_propose(args: dict) -> list[TextContent]:
|
|
4911
|
+
"""Propose a change (RFC)."""
|
|
4912
|
+
from .mcp_tools.itil_tools import _handle_itil_change_propose as _impl
|
|
4913
|
+
return await _impl(args)
|
|
4914
|
+
|
|
4915
|
+
|
|
4916
|
+
async def _handle_itil_change_update(args: dict) -> list[TextContent]:
|
|
4917
|
+
"""Update a change status."""
|
|
4918
|
+
from .mcp_tools.itil_tools import _handle_itil_change_update as _impl
|
|
4919
|
+
return await _impl(args)
|
|
4920
|
+
|
|
4921
|
+
|
|
4922
|
+
async def _handle_itil_cab_vote(args: dict) -> list[TextContent]:
|
|
4923
|
+
"""Submit a CAB vote."""
|
|
4924
|
+
from .mcp_tools.itil_tools import _handle_itil_cab_vote as _impl
|
|
4925
|
+
return await _impl(args)
|
|
4926
|
+
|
|
4927
|
+
|
|
4928
|
+
async def _handle_itil_status(args: dict) -> list[TextContent]:
|
|
4929
|
+
"""ITIL dashboard status."""
|
|
4930
|
+
from .mcp_tools.itil_tools import _handle_itil_status as _impl
|
|
4931
|
+
return await _impl(args)
|
|
4932
|
+
|
|
4933
|
+
|
|
4934
|
+
async def _handle_itil_kedb_search(args: dict) -> list[TextContent]:
|
|
4935
|
+
"""Search the Known Error Database."""
|
|
4936
|
+
from .mcp_tools.itil_tools import _handle_itil_kedb_search as _impl
|
|
4937
|
+
return await _impl(args)
|
|
4938
|
+
|
|
4939
|
+
|
|
4682
4940
|
# ═══════════════════════════════════════════════════════════
|
|
4683
4941
|
# Entry Point
|
|
4684
4942
|
# ═══════════════════════════════════════════════════════════
|
|
@@ -29,6 +29,7 @@ from . import (
|
|
|
29
29
|
gtd_tools,
|
|
30
30
|
health_tools,
|
|
31
31
|
heartbeat_tools,
|
|
32
|
+
itil_tools,
|
|
32
33
|
kms_tools,
|
|
33
34
|
memory_tools,
|
|
34
35
|
model_tools,
|
|
@@ -63,6 +64,7 @@ _MODULES = [
|
|
|
63
64
|
heartbeat_tools,
|
|
64
65
|
file_tools,
|
|
65
66
|
gtd_tools,
|
|
67
|
+
itil_tools,
|
|
66
68
|
pubsub_tools,
|
|
67
69
|
fortress_tools,
|
|
68
70
|
promoter_tools,
|
|
@@ -21,7 +21,7 @@ _GTD_LISTS = {
|
|
|
21
21
|
"someday-maybe": "someday-maybe.json",
|
|
22
22
|
}
|
|
23
23
|
|
|
24
|
-
_VALID_SOURCES = {"manual", "telegram", "email", "voice"}
|
|
24
|
+
_VALID_SOURCES = {"manual", "telegram", "email", "voice", "itil"}
|
|
25
25
|
_VALID_PRIVACY = {"private", "team", "community", "public"}
|
|
26
26
|
_VALID_STATUSES = {"inbox", "next", "project", "waiting", "someday", "reference", "done"}
|
|
27
27
|
_VALID_PRIORITIES = {"critical", "high", "medium", "low"}
|