constants

package
v1.2.0 Latest Latest
Warning

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

Go to latest
Published: Aug 8, 2025 License: MIT Imports: 1 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// DefaultScannerBufferSize is the initial buffer size for JSONL scanner (64KB)
	DefaultScannerBufferSize = 64 * 1024

	// HTMLBuilderInitialCapacity is the initial capacity for HTML string builders
	HTMLBuilderInitialCapacity = 100
)

Buffer and size limits

View Source
const (
	// BashOutputCollapseThreshold is the number of lines before bash output is collapsed
	BashOutputCollapseThreshold = 20

	// ShortUUIDLength is the number of characters to display for shortened UUIDs
	ShortUUIDLength = 8

	// MinTextLengthForPrefixMatch is the minimum text length for prefix matching
	MinTextLengthForPrefixMatch = 20

	// NumberFormattingThreshold is the minimum number to format with thousands separators
	NumberFormattingThreshold = 1000

	// ThousandsSeparatorInterval is the digit grouping for number formatting
	ThousandsSeparatorInterval = 3
)

Display thresholds

View Source
const (
	// Entry types from JSONL logs
	EntryTypeMessage    = "message"
	EntryTypeToolCall   = "tool_call"
	EntryTypeToolResult = "tool_result"
	EntryTypeSummary    = "summary"

	// Message roles
	RoleUser      = "user"
	RoleAssistant = "assistant"
	RoleSystem    = "system"

	// Content types
	ContentTypeText       = "text"
	ContentTypeToolUse    = "tool_use"
	ContentTypeToolResult = "tool_result"
)

Entry types

View Source
const (
	// TaskToolName is the name of the Task tool that creates sidechains
	TaskToolName = "Task"

	// Common tool names
	ToolNameBash      = "Bash"
	ToolNameWebSearch = "WebSearch"
	ToolNameRead      = "Read"
	ToolNameEdit      = "Edit"
	ToolNameMultiEdit = "MultiEdit"
	ToolNameWrite     = "Write"
	ToolNameTodoWrite = "TodoWrite"
)

Tool names

View Source
const (
	// DefaultVersion is used when version info is not set during build
	DefaultVersion = "1.1.0"

	// DevelopmentVersionString indicates a development build
	DevelopmentVersionString = "(devel)"

	// DevVersionString is the short form for development version
	DevVersionString = "dev"

	// UnknownVersionString is used when version cannot be determined
	UnknownVersionString = "unknown"
)

Version information

View Source
const (
	// TempFileTimestampFormat is the timestamp format for temporary files
	TempFileTimestampFormat = "20060102-150405"

	// TempFileNameFormat is the format string for temporary HTML files
	TempFileNameFormat = "cclog-%s-%s.html"

	// HTMLFileExtension is the file extension for HTML files
	HTMLFileExtension = ".html"

	// TemplateDirectoryPrefix is the prefix for template directories
	TemplateDirectoryPrefix = "templates/"

	// TemplateNameSeparator separates path components in template names
	TemplateNameSeparator = "/"
)

File formats

View Source
const (
	// Platform names for OS detection
	PlatformDarwin  = "darwin"
	PlatformLinux   = "linux"
	PlatformWindows = "windows"

	// Platform-specific commands
	MacOSOpenCommand    = "open"
	LinuxOpenCommand    = "xdg-open"
	WindowsCommand      = "cmd"
	WindowsCmdFlag      = "/c"
	WindowsStartCommand = "start"
)

Platform identifiers

View Source
const (
	// CaveatMessagePrefix identifies caveat messages in logs
	CaveatMessagePrefix = "Caveat: The messages below were generated by the user while running local commands."

	// UserInterruptionPattern identifies interrupted requests
	UserInterruptionPattern = "request interrupted by user"

	// Command XML tags
	CommandNameOpenTag    = "<command-name>"
	CommandNameCloseTag   = "</command-name>"
	CommandNameTag        = "command-name"
	CommandArgsTag        = "command-args"
	CommandStdoutTag      = "local-command-stdout"
	LocalCommandStdoutTag = "local-command-stdout"

	// Additional XML tags from processor
	TagCommandName   = "command-name"
	TagCommandArgs   = "command-args"
	TagCommandStdout = "local-command-stdout"
)

Special strings and patterns

View Source
const (
	// LineNumberStartIndex is the starting line number for diffs
	LineNumberStartIndex = 1

	// RootConversationDepth is the depth of root-level entries
	RootConversationDepth = 1
)

Processing configuration

View Source
const (
	TypeUser       = "user"
	TypeAssistant  = "assistant"
	TypeMessage    = "message"
	TypeToolUse    = "tool_use"
	TypeToolResult = "tool_result"
)

Additional entry types from processor

View Source
const (
	// DefaultToolCallMatchWindow is the time window for matching tool calls with results
	DefaultToolCallMatchWindow = 5 * time.Minute
)

Time durations

View Source
const (
	// EnglishTokenToWordRatio is the approximate ratio of tokens to words
	EnglishTokenToWordRatio = 1.3
)

Token estimation

View Source
const (
	// PerfectMatchScore indicates a perfect sidechain match
	PerfectMatchScore = 2
)

Matching scores

Variables

This section is empty.

Functions

This section is empty.

Types

This section is empty.

Jump to

Keyboard shortcuts

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