Skip to content

Commit 9bf800f

Browse files
Update package specifications for agentdrain, cli, console, constants (#39055)
1 parent 02861e3 commit 9bf800f

3 files changed

Lines changed: 35 additions & 3 deletions

File tree

pkg/agentdrain/README.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -171,6 +171,10 @@ report := detector.Analyze(result, isNew, cluster)
171171

172172
Applies `MaskRule` substitutions to log lines before tokenization.
173173

174+
#### `(*Masker).Mask(line string) string`
175+
176+
Applies all compiled mask rules to `line` in order, returning the normalized string.
177+
174178
```go
175179
masker, err := agentdrain.NewMasker(cfg.MaskRules)
176180
masked := masker.Mask(rawLine)

pkg/console/README.md

Lines changed: 29 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,8 +55,9 @@ The following components and functions are exported by the `console` package:
5555
| `ShowInteractiveList` | func | Interactive single-selection list |
5656
| `PromptInput` / `PromptSecretInput` | funcs | Text and secret input prompts |
5757
| `LogVerbose` | func | Conditional verbose logging |
58-
| `FormatFileSize` / `FormatNumber` | funcs | Human-readable byte and integer formatting |
58+
| `FormatFileSize` / `FormatNumber` / `FormatTokens` | funcs | Human-readable byte, integer, and token count formatting |
5959
| `IsAccessibleMode` | func | Detects accessibility mode |
60+
| `SetTimeLocation` / `ResetTimeLocation` | funcs | Configure `time.Time` rendering timezone |
6061
| `SpinnerWrapper` | type | Spinner controller with `Start`, `Stop`, `StopWithMessage`, and `UpdateMessage` |
6162
| `CompilerError` / `ErrorPosition` / `TableConfig` / `TreeNode` | types | Supporting data types |
6263

@@ -770,6 +771,17 @@ console.FormatNumber(1500) // "1.50k"
770771
console.FormatNumber(1_200_000) // "1.20M"
771772
```
772773

774+
### `FormatTokens(tokens int) string`
775+
776+
Formats a token count as a compact human-readable string. Zero values render as `"-"` to indicate no data; non-zero values use SI suffixes for readability.
777+
778+
```go
779+
console.FormatTokens(0) // "-"
780+
console.FormatTokens(500) // "500"
781+
console.FormatTokens(1500) // "1.5K"
782+
console.FormatTokens(1200000) // "1.2M"
783+
```
784+
773785
### `ToRelativePath(path string) string`
774786

775787
Converts an absolute path to a path relative to the current working directory. If the relative path would require traversing parent directories (`..`), the original absolute path is returned unchanged.
@@ -803,6 +815,22 @@ Returns the `gh aw` ASCII art banner as a styled string.
803815

804816
Prints the banner to `os.Stderr`.
805817

818+
### `SetTimeLocation(location *time.Location)`
819+
820+
Configures the `time.Location` used when rendering `time.Time` values in `RenderStruct`. When set, rendered timestamps include the UTC offset (e.g. `"2026-01-15 09:30:00 UTC+09:00"`). Pass `nil` to reset to the default (`"2006-01-02 15:04:05"` in the local zone).
821+
822+
### `ResetTimeLocation()`
823+
824+
Clears any configured time location override, restoring the default formatting behaviour.
825+
826+
```go
827+
// Display times in Japan Standard Time
828+
loc, _ := time.LoadLocation("Asia/Tokyo")
829+
console.SetTimeLocation(loc)
830+
defer console.ResetTimeLocation()
831+
fmt.Print(console.RenderStruct(myData))
832+
```
833+
806834
## Accessibility
807835

808836
### `IsAccessibleMode() bool`

pkg/constants/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -252,7 +252,7 @@ constants.AgenticWorkflowsMCPServerID // "agenticworkflows"
252252

253253
```go
254254
// AI engine CLIs
255-
constants.DefaultCopilotVersion // Copilot CLI version (e.g. "1.0.21")
255+
constants.DefaultCopilotVersion // Copilot CLI version (e.g. "1.0.60")
256256
constants.DefaultClaudeCodeVersion // Claude Code CLI version
257257
constants.DefaultCodexVersion // OpenAI Codex CLI version
258258
constants.DefaultGeminiVersion // Google Gemini CLI version
@@ -274,7 +274,7 @@ constants.DefaultGitHubScriptVersion // actions/github-script action version
274274
// Runtime setup versions
275275
constants.DefaultNodeVersion // Node.js (e.g. "24")
276276
constants.DefaultPythonVersion // Python (e.g. "3.12")
277-
constants.DefaultGoVersion // Go (e.g. "1.25")
277+
constants.DefaultGoVersion // Go (e.g. "1.26")
278278
constants.DefaultBunVersion // Bun
279279
constants.DefaultRubyVersion // Ruby
280280
constants.DefaultDotNetVersion // .NET

0 commit comments

Comments
 (0)