# Yunke — paused profile provisioning and read-only detail

Part of the [AI Voice Agent](/docs/modules_handbook/shared/voice-agent/readMe.md).
Built 2026-10-25. Runtime gates remain off; all verification used synthetic fixtures.

Updated 2026-10-26: platform super administrators can also create/edit paused phone
profiles in the [Yunke console](/docs/modules_handbook/shared/voice-agent/yunke-console.md).
That dedicated local form does not publish Retell content or submit vendor tasks.
The command and read-only profile panels described below remain available.

## What it does

`voice-agent:yunke-profile` provisions a **paused local platform profile**, with explicit
App mode, market prefix, positive daily cap and bounded phone window. It does not create
a vendor task, authenticate, contact a phone or change any calling/result gate. This
fulfills the original plan's command-based setup and read-only Yunke detail: the normal
browser content form remains a Retell publishing form, rather than a second task sender.

Both profile suites now show a separate phone profile panel instead of Retell's prompt,
sync, testing and copilot tools. The index distinguishes the provider and local
availability. Agency screens use generic phone/cloud labels to retain their existing
white-label convention. Knowledge shown for a phone caller is managed outside petaV3;
the local settings hash does not verify that remote conversation content.

## How it works

### Local provisioning

The command requires a name and `--cap`; `--prefix=60` and `--window=10:00-21:00` are
defaults. Prefixes are digits without `+`, the cap is a positive whole number, and
the window may be any same-day hours, start before end (the old 10:00–21:00 bound was
removed 2026-11-10). Invalid or duplicate-name requests
create nothing and never modify an existing profile. A profile cap is not a verified
SIM-wide quota or a physical-phone inventory.

The repository admits provider/settings/initial status only on nested **create** input;
ordinary content/routing `update()` cannot change them. Other profile creation retains
its previous active default. The command sets provider=yunke, mode=app_single_task,
status=inactive, a market/cap/window, and no Retell agent or standing task. The existing
transactional repository stamps its local settings hash. No new migration is required.
This command creates platform profiles (`group_id=null`) for the current platform pilot;
it does not provision an agency-owned phone or introduce per-agency vendor credentials.

### Safe display and local pause

Page props expose only a `phone_configuration` display whitelist: mode, legacy task ID,
market prefixes, cap, canonical window/timezone and local availability. They never send
the raw provider_settings object, token or Cookie. App mode has no standing task ID;
the per-attempt accepted parent belongs to the binding ledger.

Availability distinguishes calling disabled, incomplete configuration, locally paused,
configured locally and unsupported legacy adapter. It is **not** an authenticated
device/USB health check. Old Retell IDs/sync stamps on a phone row cannot make its
display synced, expose chat tools or justify a Retell API call. The phone detail also
skips the Retell voice-catalogue request.

With `manage-calls`, the panel may pause/allow **new local submissions** through the
existing scoped toggle. Both suite routes enforce that permission. The action changes
only profile status: global gates stay unchanged, and existing mobile tasks are neither
cancelled nor paused. Hardware stop/expiry/cancellation still require real proof and
the appropriate separate authorization.

### Retell-only action guards

Both suites reject phone/unsupported profiles before content update, pull, phone test,
chat start/send, browser audio test, copilot/apply and profile deletion. Existing Sync
already has its provider guard. This remains true even with stale Retell agent/chat IDs.
The UI hides those actions; backend guards prevent bypassing the hidden buttons.
Deleting a local phone profile is not offered as an unverified remote stop operation.

Browser creation explicitly accepts only Retell (or the existing omitted-provider
default). A crafted `provider=yunke` request cannot silently create/publish Retell.
No public phone-profile mutation API or credential editor was introduced. Legacy
standing-task profiles remain unavailable and are never silently migrated to App mode.

## Reference usage

After a separately approved installation, an operator can prepare local configuration:

```bash
php artisan voice-agent:yunke-profile 'Yunke MY pilot' --prefix=60 --cap=20 --window=10:00-21:00
```

This is configuration provisioning, not a live test. This implementation ran it only
inside the guarded test database. Do not run it against production as part of offline
verification. Creating it or allowing its local status never enables global gates.
The existing [routing controls](/docs/modules_handbook/shared/voice-agent/pilot-routing-ui.md)
can later select a prepared variant; unavailable arms are still refused, not rerouted.

`YunkeProfileUiTest` verifies paused provisioning, invalid/duplicate inputs, safe props,
local readiness, both suites' action guards and toggle permissions, with no external
HTTP, calls or messages. `PhoneProfilePanel.test.js` verifies read-only rendering,
permissions, generic agency labels and the local-only toggle payload.

## Related files

- [CreateYunkeProfile](/app/Console/Commands/CreateYunkeProfile.php), [AiCallProfileRepository](/src/VoiceAgent/Repositories/AiCallProfileRepository.php) — validated command and transactional creation.
- [AiProfilesController](/app/Http/Controllers/Manage/Calls/AiProfilesController.php), [StoreRequest](/app/Http/Requests/Manage/Calls/AiProfile/StoreRequest.php), [routes](/routes/web.php) — display whitelist, provider guards and permissions.
- [PhoneProfilePanel.vue](/resources/js/Pages/Manage/Calls/AiProfiles/Partials/PhoneProfilePanel.vue) — shared read-only detail used by both profile suites; their index/show components select provider-specific presentation.
- [YunkeProfileUiTest](/tests/Feature/VoiceAgent/YunkeProfileUiTest.php), [PhoneProfilePanel.test.js](/resources/js/Pages/Manage/Calls/AiProfiles/Partials/PhoneProfilePanel.test.js) — synthetic verification and Retell regressions.
- [App caller contract](/docs/modules_handbook/shared/voice-agent/yunke-app-caller.md), [PDF progress](/docs/modules_handbook/shared/voice-agent/yunke-pdf-progress.md) — placement prerequisites and remaining engineering/live acceptance.
