Skip to content

Open-source LLM knowledge platform: turn raw documents into a queryable RAG, an autonomous reasoning agent, and a self-maintaining Wiki.

10.9 KB
Raw Blame
// Inline interaction rows for OAuth / tool-approval in agent stream.
@import '../../../components/css/chat-timeline-loading.less';

.action-card.interaction-inline {
  gap: 0;
}

.action-header {
  display: flex;
  align-items: center;
  min-height: 24px;
  padding: 0;
  cursor: default;
  user-select: none;
}

.action-card {
  background: transparent;
  border: 0;
  box-shadow: none;
  display: flex;
  flex-direction: column;
}

.interaction-status-summary {
  padding: 2px 0 0;

  &.is-clickable {
    cursor: pointer;
    user-select: none;

    .results-summary-text {
      color: var(--agent-step-color, var(--td-text-color-secondary));
      transition: color var(--app-motion-fast) ease;
    }

    &:hover .results-summary-text {
      color: var(--agent-step-color, var(--td-text-color-secondary));
    }
  }

  .results-summary-text {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px;
    font-size: var(--agent-step-summary-size, 13px);
    font-weight: 400;
    line-height: 1.55;
    color: var(--agent-step-color, var(--td-text-color-secondary));
  }

  .status-label {
    flex-shrink: 0;
  }

  .inline-actions {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
  }

  .action-timer {
    font-size: var(--app-text-sm);
    line-height: 1.55;
    font-variant-numeric: tabular-nums;
    color: var(--agent-step-color, var(--td-text-color-secondary));
    white-space: nowrap;
    flex-shrink: 0;

    &.timer-warning {
      color: var(--td-warning-color);
    }

    &.timer-critical {
      color: var(--td-error-color);
    }
  }
}

.inline-dot {
  color: var(--agent-step-color, var(--td-text-color-secondary));
  font-size: var(--app-text-sm);
  line-height: 1;
  user-select: none;
}

.inline-action {
  appearance: none;
  border: 0;
  background: transparent;
  padding: 0;
  margin: 0;
  font-size: var(--agent-step-summary-size, 13px);
  line-height: 1.55;
  color: var(--agent-step-color, var(--td-text-color-secondary));
  cursor: pointer;
  transition: color var(--app-motion-fast) ease;

  &:hover:not(:disabled) {
    color: var(--agent-step-color, var(--td-text-color-secondary));
  }

  &:disabled {
    opacity: 0.45;
    cursor: not-allowed;
  }

  &.is-primary {
    color: var(--td-brand-color);

    &:hover:not(:disabled) {
      color: var(--td-brand-color-hover);
    }
  }
}

.action-title {
  display: flex;
  align-items: center;
  gap: 12px;
  position: relative;
  flex: 1;
  min-width: 0;
  flex-wrap: wrap;
  row-gap: 2px;

  .action-title-icon {
    position: absolute;
    left: -42px;
    top: 3px;
    flex-shrink: 0;
    width: 18px;
    height: 18px;
    color: var(--agent-step-icon-color, var(--td-text-color-secondary));
  }

  .action-name {
    font-size: var(--agent-step-text-size, 14px);
    line-height: 1.55;
    font-weight: 400;
    color: var(--agent-step-color, var(--td-text-color-secondary));
    white-space: nowrap;
    flex-shrink: 0;
  }

  .inline-actions {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
  }

  .action-timer {
    font-size: var(--app-text-sm);
    line-height: 1.55;
    font-variant-numeric: tabular-nums;
    color: var(--td-text-color-placeholder);
    white-space: nowrap;
    flex-shrink: 0;

    &.timer-warning {
      color: var(--td-warning-color);
    }

    &.timer-critical {
      color: var(--td-error-color);
    }
  }
}

.interaction-args-block {
  padding: 4px 0 0;
}

.interaction-args-preview {
  padding: 4px 0 0;
  font-family: var(--app-font-family-mono, ui-monospace, SFMono-Regular, Menlo, monospace);
  font-size: var(--agent-step-summary-size, 13px);
  line-height: 1.55;
  color: var(--td-text-color-secondary);
  white-space: pre-wrap;
  word-break: break-word;
  max-height: 160px;
  overflow: auto;
}

.interaction-args-input {
  :deep(.t-textarea__inner) {
    font-family: var(--app-font-family-mono, ui-monospace, SFMono-Regular, Menlo, monospace);
    font-size: var(--agent-step-summary-size, 13px);
    line-height: 1.55;
    background: transparent;
    border: 0;
    box-shadow: none;
    color: var(--td-text-color-secondary);
    padding: 0;
    border-radius: 0;
    min-height: 36px;
    resize: vertical;

    &:focus {
      box-shadow: none;
    }
  }
}

.interaction-args-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: var(--agent-step-summary-size, 13px);
  color: var(--td-text-color-placeholder);

  .args-status {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    font-size: var(--agent-step-summary-size, 13px);
  }
}

.args-status {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font-size: var(--agent-step-summary-size, 13px);

  &.args-invalid {
    color: var(--td-error-color);
  }

  &.args-dirty {
    color: var(--td-warning-color);
  }
}

.action-details {
  padding: 4px 0 0;
  border-top: 0;
  background: transparent;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.args-toggle-row {
  gap: 4px;
}

.args-toggle-icon {
  flex-shrink: 0;
  font-size: var(--app-text-sm);
  color: var(--td-text-color-placeholder);
}

// The answerable form of a prompt, rendered in the dock above the composer.
.prompt-panel {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.prompt-question {
  font-size: var(--app-text-base, 14px);
  line-height: 1.55;
  font-weight: 500;
  color: var(--td-text-color-primary);
  white-space: pre-wrap;
  word-break: break-word;
}

.prompt-desc {
  margin-top: -4px;
  font-size: var(--agent-step-summary-size, 13px);
  line-height: 1.55;
  color: var(--td-text-color-secondary);
  white-space: pre-line;
  word-break: break-word;
  max-height: calc(1.55em * 8);
  overflow-y: auto;
}

// One grid for all rows, so every value starts at the same column.
.prompt-fields {
  display: grid;
  grid-template-columns: fit-content(120px) minmax(0, 1fr);
  column-gap: 16px;
  row-gap: 6px;
  align-items: baseline;
  margin: 0;
  padding: 10px 12px;
  border-radius: var(--app-radius-md);
  background: var(--td-bg-color-secondarycontainer);
  font-size: var(--agent-step-summary-size, 13px);
  line-height: 1.55;
  max-height: calc(1.55em * 9 + 20px);
  overflow-y: auto;
}

.prompt-field {
  display: contents;

  dt {
    margin: 0;
    color: var(--td-text-color-placeholder);
  }

  dd {
    margin: 0;
    color: var(--td-text-color-primary);
    overflow-wrap: anywhere;
  }
}

.prompt-field-count {
  margin-left: 6px;
  color: var(--td-text-color-placeholder);
  white-space: nowrap;
}

.prompt-desc-items {
  margin: -4px 0 0;
  padding-left: 18px;
  max-height: calc(1.55em * 8);
  overflow-y: auto;
  font-size: var(--agent-step-summary-size, 13px);
  line-height: 1.55;
  color: var(--td-text-color-secondary);
  word-break: break-word;
}

.prompt-options {
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin: 0 -8px;
}

.prompt-option {
  appearance: none;
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 6px 8px;
  border: 0;
  border-radius: var(--app-radius-md);
  background: transparent;
  font: inherit;
  font-size: var(--app-text-base, 14px);
  line-height: 1.5;
  text-align: left;
  color: var(--td-text-color-primary);
  cursor: pointer;
  transition: background var(--app-motion-fast) ease;

  &:hover:not(:disabled),
  &:focus-visible {
    background: var(--td-bg-color-container-hover);
    outline: none;
  }

  &:disabled {
    opacity: 0.6;
    cursor: not-allowed;
  }

  &.is-selected {
    background: var(--td-bg-color-container-hover);

    .prompt-option-key {
      background: var(--td-brand-color);
      color: var(--td-text-color-anti);
    }
  }
}

.prompt-option-key {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  border-radius: var(--app-radius-sm);
  background: var(--td-bg-color-secondarycontainer);
  font-size: var(--app-text-sm);
  font-weight: 500;
  color: var(--td-text-color-secondary);
  transition: background var(--app-motion-fast) ease, color var(--app-motion-fast) ease;
}

.prompt-option-label {
  flex: 1;
  min-width: 0;
  word-break: break-word;
}

.prompt-option-check {
  flex-shrink: 0;
  color: var(--td-brand-color);
}

.prompt-args {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.prompt-args-toggle {
  appearance: none;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  align-self: flex-start;
  padding: 0;
  border: 0;
  background: transparent;
  font: inherit;
  font-size: var(--agent-step-summary-size, 13px);
  line-height: 1.55;
  color: var(--td-text-color-secondary);
  cursor: pointer;

  &:hover {
    color: var(--td-text-color-primary);
  }

  .args-status {
    margin-left: 6px;
  }
}

.prompt-args-input {
  :deep(.t-textarea__inner) {
    font-family: var(--app-font-family-mono, ui-monospace, SFMono-Regular, Menlo, monospace);
    font-size: var(--agent-step-summary-size, 13px);
    line-height: 1.55;
    background: var(--td-bg-color-secondarycontainer);
    border-color: transparent;
    border-radius: var(--app-radius-md);
    color: var(--td-text-color-secondary);
  }
}

.prompt-grant {
  align-self: flex-start;
  font-size: var(--agent-step-summary-size, 13px);
  color: var(--td-text-color-secondary);
}

.prompt-grant-lapsed {
  font-size: var(--agent-step-summary-size, 13px);
  color: var(--td-warning-color);
}

.prompt-grant-scope {
  margin-left: 6px;
  color: var(--td-text-color-placeholder);
  word-break: break-word;
}

.prompt-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.prompt-footer-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;

  .action-timer {
    font-size: var(--app-text-sm);
    line-height: 1.55;
    font-variant-numeric: tabular-nums;
    color: var(--td-text-color-placeholder);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;

    &.timer-warning {
      color: var(--td-warning-color);
    }

    &.timer-critical {
      color: var(--td-error-color);
    }
  }
}

.prompt-footer-actions {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
}

.prompt-btn {
  appearance: none;
  display: inline-flex;
  align-items: center;
  height: 28px;
  padding: 0 12px;
  border: 0;
  border-radius: var(--app-radius-md);
  background: transparent;
  font: inherit;
  font-size: var(--agent-step-summary-size, 13px);
  color: var(--td-text-color-secondary);
  cursor: pointer;
  transition: background var(--app-motion-fast) ease, color var(--app-motion-fast) ease;

  &:hover:not(:disabled) {
    background: var(--td-bg-color-container-hover);
    color: var(--td-text-color-primary);
  }

  &.is-primary {
    background: var(--td-brand-color);
    color: var(--td-text-color-anti);

    &:hover:not(:disabled) {
      background: var(--td-brand-color-hover);
      color: var(--td-text-color-anti);
    }
  }

  &:disabled {
    opacity: 0.45;
    cursor: not-allowed;
  }
}

.prompt-btn-key {
  margin-left: 6px;
  font-size: var(--app-text-sm);
  opacity: 0.75;
}