Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
139 changes: 139 additions & 0 deletions assets/css/agents.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,139 @@
/**
* Agents — "Agent chat" window styles.
*
* Conversation surface painted by the `agent-run-window` bundle
* (src/agent-run-window.ts). Same conventions as the other window
* stylesheets: `desktop-mode-*` / `dm-*` prefixes, theming via the
* desktop-mode-variables custom properties.
*
*/

.desktop-mode-agent-run {
display: flex;
flex-direction: column;
width: 100%;
height: 100%;
min-height: 0;
font-family: var(
--desktop-mode-font,
-apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif
);
color: var( --wpd-fg, #1d2327 );
background: var( --desktop-mode-window-bg, #fff );
box-sizing: border-box;
}

.desktop-mode-agent-run__loading {
display: flex;
align-items: center;
justify-content: center;
height: 100%;
}

.dm-agent-chat {
display: flex;
flex-direction: column;
height: 100%;
min-height: 0;
}

.dm-agent-chat__head {
display: flex;
align-items: center;
gap: 10px;
padding: 12px;
border-bottom: 1px solid var( --desktop-mode-border, rgba( 0, 0, 0, 0.08 ) );
}

.dm-agent-chat__avatar {
width: 40px;
height: 40px;
border-radius: 50%;
background: #fff;
flex: none;
}

.dm-agent-chat__title {
display: flex;
flex-direction: column;
min-width: 0;
}

.dm-agent-chat__desc {
font-size: 12px;
opacity: 0.65;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
}

.dm-agent-chat__scroll {
flex: 1;
min-height: 0;
overflow-y: auto;
padding: 12px;
display: flex;
flex-direction: column;
gap: 10px;
}

.dm-agent-chat__msg {
max-width: 85%;
border-radius: 12px;
padding: 8px 12px;
display: flex;
flex-direction: column;
gap: 6px;
font-size: 13px;
line-height: 1.5;
}

.dm-agent-chat__msg--user {
align-self: flex-end;
background: var( --desktop-mode-accent, #2271b1 );
color: #fff;
}

.dm-agent-chat__msg--agent {
align-self: flex-start;
background: var( --desktop-mode-hover, rgba( 0, 0, 0, 0.06 ) );
}

.dm-agent-chat__msg--error {
align-self: flex-start;
background: rgba( 214, 54, 56, 0.12 );
color: #8a1f21;
}

.dm-agent-chat__msg-text {
white-space: pre-wrap;
word-break: break-word;
}

.dm-agent-chat__tools {
font-size: 12px;
opacity: 0.8;
}

.dm-agent-chat__tools summary {
cursor: pointer;
}

.dm-agent-chat__tool {
font-family: monospace;
font-size: 11px;
padding: 2px 0;
word-break: break-all;
}

.dm-agent-chat__composer {
display: flex;
align-items: flex-end;
gap: 8px;
padding: 10px 12px;
border-top: 1px solid var( --desktop-mode-border, rgba( 0, 0, 0, 0.08 ) );
}

.dm-agent-chat__composer wpd-textarea {
flex: 1;
}
224 changes: 223 additions & 1 deletion assets/css/my-wordpress.css
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
* BEM-ish prefix, container-relative geometry, theming via the
* desktop-mode-variables CSS custom properties).
*
* @since 0.8.0
*/

.desktop-mode-my-wordpress {
Expand Down Expand Up @@ -1879,3 +1878,226 @@ wpd-tile[ status='future' ] .desktop-mode-file-tile__icon {
* fighting the summary bar's spacing. */
display: block;
}

/* ------------------------------------------------------------------ */
/* Agents section (`agent` entity kind — src/my-wordpress/agents-renderer.ts) */
/* ------------------------------------------------------------------ */

.dm-agents {
display: flex;
flex-direction: column;
height: 100%;
min-height: 0;
padding: 12px;
gap: 10px;
overflow: hidden;
box-sizing: border-box;
}

.dm-agents__loading {
display: flex;
align-items: center;
justify-content: center;
height: 100%;
}

.dm-agents__layout {
display: flex;
flex: 1;
min-height: 0;
gap: 12px;
}

.dm-agents__list {
display: flex;
flex-direction: column;
gap: 4px;
flex: 0 0 260px;
overflow-y: auto;
padding-right: 4px;
border-right: 1px solid var( --desktop-mode-border, rgba( 0, 0, 0, 0.08 ) );
}

.dm-agents__row {
display: flex;
align-items: center;
gap: 8px;
padding: 8px;
border-radius: 8px;
cursor: pointer;
}

.dm-agents__row:hover {
background: var( --desktop-mode-hover, rgba( 0, 0, 0, 0.06 ) );
}

.dm-agents__row.is-selected {
background: var( --desktop-mode-selected, rgba( 0, 0, 0, 0.1 ) );
}

.dm-agents__row-avatar {
width: 32px;
height: 32px;
border-radius: 50%;
background: #fff;
flex: none;
}

.dm-agents__row-text {
display: flex;
flex-direction: column;
min-width: 0;
flex: 1;
}

.dm-agents__row-name {
font-weight: 600;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
}

.dm-agents__row-desc {
font-size: 12px;
opacity: 0.65;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
}

.dm-agents__create {
margin-top: 8px;
}

.dm-agents__detail {
flex: 1;
min-width: 0;
overflow-y: auto;
display: flex;
flex-direction: column;
gap: 10px;
}

.dm-agents__detail-head {
display: flex;
align-items: center;
gap: 10px;
}

.dm-agents__detail-avatar {
width: 48px;
height: 48px;
border-radius: 50%;
background: #fff;
flex: none;
}

.dm-agents__detail-title {
flex: 1;
min-width: 0;
}

.dm-agents__detail-title h3 {
margin: 0;
font-size: 16px;
}

.dm-agents__detail-slug {
font-size: 12px;
opacity: 0.6;
}

.dm-agents__tabs {
display: flex;
gap: 4px;
border-bottom: 1px solid var( --desktop-mode-border, rgba( 0, 0, 0, 0.08 ) );
}

.dm-agents__tab {
appearance: none;
background: none;
border: none;
border-bottom: 2px solid transparent;
padding: 6px 10px;
font: inherit;
color: inherit;
cursor: pointer;
opacity: 0.7;
}

.dm-agents__tab.is-active {
border-bottom-color: var( --desktop-mode-accent, #2271b1 );
opacity: 1;
font-weight: 600;
}

.dm-agents__pane {
display: flex;
flex-direction: column;
gap: 10px;
padding-bottom: 12px;
}

.dm-agents__hint {
margin: 0;
font-size: 12px;
opacity: 0.7;
}

.dm-agents__category {
margin: 8px 0 0;
font-size: 12px;
text-transform: uppercase;
letter-spacing: 0.04em;
opacity: 0.6;
}

.dm-agents__ability {
display: grid;
grid-template-columns: 1fr auto;
gap: 2px 8px;
align-items: center;
padding: 4px 0;
}

.dm-agents__ability-desc {
grid-column: 1 / -1;
margin: 0;
font-size: 12px;
opacity: 0.6;
}

.dm-agents__trigger {
border: 1px solid var( --desktop-mode-border, rgba( 0, 0, 0, 0.08 ) );
border-radius: 8px;
padding: 8px 10px;
display: flex;
flex-direction: column;
gap: 6px;
}

.dm-agents__trigger-head {
display: flex;
align-items: center;
gap: 8px;
}

.dm-agents__trigger-summary {
flex: 1;
font-size: 12px;
opacity: 0.65;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
}

.dm-agents__trigger-config {
display: flex;
flex-wrap: wrap;
gap: 4px 14px;
}

.dm-agents__actions {
display: flex;
gap: 8px;
}
1 change: 1 addition & 0 deletions desktop-mode.php
Original file line number Diff line number Diff line change
Expand Up @@ -151,6 +151,7 @@ function desktop_mode_request_needs_admin_modules() {
require_once DESKTOP_MODE_DIR . 'includes/content-graph/bootstrap.php';
require_once DESKTOP_MODE_DIR . 'includes/living-tree/bootstrap.php';
require_once DESKTOP_MODE_DIR . 'includes/games/bootstrap.php';
require_once DESKTOP_MODE_DIR . 'includes/agents/bootstrap.php';
require_once DESKTOP_MODE_DIR . 'includes/pwa.php';
require_once DESKTOP_MODE_DIR . 'includes/compat/divi.php';

Expand Down
Loading