(title string, value any)
| 1875 | } |
| 1876 | |
| 1877 | func memoryObjectBundle(title string, value any) outputBundle { |
| 1878 | return outputBundle{ |
| 1879 | jsonValue: value, |
| 1880 | jsonl: func(cmd *cobra.Command) error { |
| 1881 | return writeJSONLine(cmd, value) |
| 1882 | }, |
| 1883 | human: func() (string, error) { |
| 1884 | data, err := json.MarshalIndent(value, "", " ") |
| 1885 | if err != nil { |
| 1886 | return "", fmt.Errorf("cli: render %s: %w", title, err) |
| 1887 | } |
| 1888 | return renderHumanBlocks(title, string(data)), nil |
| 1889 | }, |
| 1890 | toon: func() (string, error) { |
| 1891 | data, err := json.Marshal(value) |
| 1892 | if err != nil { |
| 1893 | return "", fmt.Errorf("cli: render %s toon: %w", title, err) |
| 1894 | } |
| 1895 | return renderToonObject(memoryMemoryKey, []string{memoryPayloadKey}, []string{string(data)}), nil |
| 1896 | }, |
| 1897 | } |
| 1898 | } |
| 1899 | |
| 1900 | func memoryScopeLabel(scope memcontract.Scope, tier memcontract.AgentTier) string { |
| 1901 | normalized := scope.Normalize() |
no test coverage detected