Skip to content

forcedotcom/sf-skills / plugins/builder/service-omni/skills/service-omni-command-center-configure

service-omni-command-center-configure

Verified

Use to enable Command Center for Service V2 and configure its supported supervisor controls through the OmniChannel Settings Metadata API while preserving unrelated settings. Requires explicit apply consent, refuses production customer orgs, and verifies the seeded V2 page and tab. TRIGGER when: enable Command Center V2, configure conversation monitoring, enable agent sneak peek, enable customer sneak peek, configure whisper messaging, or enable queues and skills actions. Do not use to assign supervisor permissions or configure classic OmniSupervisorConfig metadata.

scripts/settings_document.py

View on GitHub
#!/usr/bin/env python3
"""Inspect or safely mutate a retrieved OmniChannel Settings document."""

import argparse
import json
import sys
import xml.etree.ElementTree as ET
from pathlib import Path
from typing import List, Optional, Tuple


METADATA_NS = "http://soap.sforce.com/2006/04/metadata"
FIELDS = (
    "enableCommandCenterForServiceV2",
    "enableConversationMonitoring",
    "enableAgentSneakPeek",
    "enableClientSneakPeek",
    "enableWhisperMessaging",
    "enableSkillsAndQueueActions",
)


def parse_document(path: Path) -> Tuple[ET.ElementTree, ET.Element]:
    tree = ET.parse(path)
    return tree, tree.getroot()


def find_element(root: ET.Element, name: str) -> Optional[ET.Element]:
    return root.find(f"{{{METADATA_NS}}}{name}")


def inspect(path: Path) -> int:
    _, root = parse_document(path)
    settings = {}
    for name in FIELDS:
        element = find_element(root, name)
        text = (element.text or "").strip().lower() if element is not None else ""
        settings[name] = {
            "present": element is not None,
            "value": text == "true" if text in {"true", "false"} else None,
        }
    print(json.dumps({"settings": settings}, separators=(",", ":")))
    return 0


def render(source: Path, destination: Path, assignments: List[str]) -> int:
    tree, root = parse_document(source)
    requested = {}
    for assignment in assignments:
        if "=" not in assignment:
            raise ValueError(f"Invalid assignment: {assignment}")
        name, value = assignment.split("=", 1)
        if name not in FIELDS:
            raise ValueError(f"Unsupported setting: {name}")
        if value not in {"true", "false"}:
            raise ValueError(f"Invalid boolean for {name}: {value}")
        requested[name] = value

    if "enableCommandCenterForServiceV2" not in requested:
        raise ValueError("enableCommandCenterForServiceV2 must be requested")

    for name, value in requested.items():
        element = find_element(root, name)
        if element is None:
            element = ET.SubElement(root, f"{{{METADATA_NS}}}{name}")
        element.text = value

    ET.register_namespace("", METADATA_NS)
    destination.parent.mkdir(parents=True, exist_ok=True)
    tree.write(destination, encoding="UTF-8", xml_declaration=True)
    return 0


def main() -> int:
    parser = argparse.ArgumentParser()
    subparsers = parser.add_subparsers(dest="operation", required=True)

    inspect_parser = subparsers.add_parser("inspect")
    inspect_parser.add_argument("path", type=Path)

    render_parser = subparsers.add_parser("render")
    render_parser.add_argument("source", type=Path)
    render_parser.add_argument("destination", type=Path)
    render_parser.add_argument("assignments", nargs="+")

    args = parser.parse_args()
    try:
        if args.operation == "inspect":
            return inspect(args.path)
        return render(args.source, args.destination, args.assignments)
    except (ET.ParseError, OSError, ValueError) as error:
        print(json.dumps({"error": str(error)}, separators=(",", ":")), file=sys.stderr)
        return 1


if __name__ == "__main__":
    raise SystemExit(main())
reverse-engineer-anythingmorluto/reaReverse engineer native, managed, Electron/JavaScript, packaged, firmware, and browser targets with REA, and build agent environments (AgentEnv bundles) of web applications from a live instance or a capture, and of Linux desktop apps with a task from a request. Use shipped-artifact or requested runtime evidence to explain features, compare versions, decompile code, or guide a reconstruction. Skip REA for ordinary source-repository architecture analysis.Stars: 472kUpdated Claude CodeCodexVerifiedInstall
diagnosing-superpowersobra/superpowersUse when a superpowers session went wrong and your human partner wants to know why — repeated work, ignored plans, stumbles, poor results, a skill that didn't fire, "it took too long", "why is it so expensive", "what is it doing" — or wants to build a bug report for the superpowers maintainers, for the current session or a past one identified by id or path, on any harness.Stars: 322kUpdated Claude CodeCodexVerifiedInstall
dispatching-parallel-agentsobra/superpowersUse when facing 2+ independent tasks that can be worked on without shared state or sequential dependenciesStars: 322kUpdated Claude CodeCodexVerifiedInstall
executing-plansobra/superpowersUse when executing an implementation plan in the current session as the implementer yourself — your human partner chose inline execution, or no subagent tool is availableStars: 322kUpdated Claude CodeCodexVerifiedInstall