titlegen

package
v0.1.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 9, 2026 License: MIT Imports: 2 Imported by: 0

Documentation

Overview

Package titlegen 为会话生成「即时兜底标题」(无 LLM)。

用途:用户发首条消息、harness 尚未生成标题前,先给侧栏一个可读标题。 真正的权威标题由 harness 生成、经 ACP session_info_update 推送或 session/list 读取; 本包只负责权威标题到达前的瞬时显示(去 markdown/命令/引号,截断 maxChars)。

归一化逻辑移植自 wesight (MIT):src/shared/cowork/sessionTitle.ts (buildSessionTitleContext / normalizeSessionTitleToPlainText)。

=== wesight MIT 版权声明 === Copyright (c) freestylefly (https://github.com/freestylefly/wesight) Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BuildContext

func BuildContext(input string) string

BuildContext 从原始输入抽取干净的上下文(去空行、压空白、限行限长)。

func FallbackTitle

func FallbackTitle(input, fallback string) string

FallbackTitle 从用户输入即时生成纯文本标题(无 LLM),用于 harness 标题到达前的瞬时显示。

func Normalize

func Normalize(value, fallback string) string

Normalize 把任意文本(可能含 markdown / 标签 / 引号)归一化为纯文本标题。 空或归一化后仍空则返回 fallback。

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL